Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to add the /signalr/hubs to the page, it's a javascript dynamically generated by SignalR containing method stubs for your hubs and the methods on the hubs.</p> <p>So if you have a .NET-hub named <code>TestHub</code>, with a method called <code>SendMessage(string message)</code> javascript will be generated so you can from JavaScript call: <code>$.connection.testHub.sendMessage("some message to server");</code> </p> <p>Point your browser to the url: /signalr/hubs, and you should get a javascript.</p> <p>about 150 lines down you will see the ticketHub stub:</p> <pre><code>$.extend(signalR, { ticketHub: { _: { hubName: 'YourNameSpace.TicketHub', ignoreMembers: ['someMethod', 'namespace', 'ignoreMembers', 'callbacks'], connection: function () { return signalR.hub; } }, </code></pre> <p>You can use Mozilla Firebug plugin or Chrome developer tools (wrench-icon->Tools->Developer Tools) to see what's sent to and returned from server.</p> <p>EDIT: There was a bug in SignalR preventing /signalr/hubs to be correctly generated (it didn't generate the method stubs). <a href="https://github.com/SignalR/SignalR/issues/134">https://github.com/SignalR/SignalR/issues/134</a></p> <p>EDIT2: you could have a incorrect script tag, try:</p> <pre><code>&lt;script src="@Url.Content("~/signalr/hubs")" type="text/javascript"&gt;&lt;/script&gt; </code></pre> <p>or you haven't referenced the <code>SignalR.AspNet.dll</code> assembly. If I recall correctly it's that assembly that wires up the route to /signalr.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload