mvc 4.0, knockout.js, bootstrap and ef6 filesignalr hosts host agnostic –run in asp.net or stand...

12
ASP.NET MVC http://nbende.wordpress.com

Upload: others

Post on 03-Sep-2019

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

ASP.NET MVChttp://nbende.wordpress.com

Page 2: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

Agenda

• Getting started with SignalR

• Using SignalR for Dual Communication modes

Page 3: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN
Page 4: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

Why use SignalR?

Page 5: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN
Page 6: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

SignalR Hosts

Host agnostic – run in asp.net or stand alone

with self-host on OWIN

Page 7: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

What to include?

Page 8: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

Hubs and Connections

Connections – LOW LEVEL

Raw strings up and down

Broadcast to all clients, groups or individuals

Connection, reconnection and disconnection semantics

Hubs – Bit higher level

Client-server and server-client

Automatic client proxy generation

Page 9: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

Getting started with SignalR

Page 10: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

To Start

Page 11: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

<body>

<div class="container">

<input type="text" id="message" />

<input type="button" id="sendmessage" value="Send" />

<input type="hidden" id="displayname" />

<ul id="discussion">

</ul>

</div>

<!--Script references. -->

<script src="Scripts/jquery-1.6.4.min.js" ></script>

<script src="Scripts/jquery.signalR-2.1.0.min.js"></script>

<script src="signalr/hubs"></script>

<!--Add script to update the page and send messages.-->

<script type="text/javascript">

$(function () {

// Declare a proxy to reference the hub.

var chat = $.connection.chatHub;

// Create a function that the hub can call to broadcast messages.

chat.client.broadcastMessage = function (name, message) {

Page 12: MVC 4.0, Knockout.js, Bootstrap and EF6 fileSignalR Hosts Host agnostic –run in asp.net or stand alone with self-host on OWIN

Questions?