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.
So if you have a .NET-hub named TestHub
, with a method called SendMessage(string message)
javascript will be generated so you can from JavaScript call: $.connection.testHub.sendMessage("some message to server");
Point your browser to the url: /signalr/hubs, and you should get a javascript.
about 150 lines down you will see the ticketHub stub:
$.extend(signalR, {
ticketHub: {
_: {
hubName: 'YourNameSpace.TicketHub',
ignoreMembers: ['someMethod', 'namespace', 'ignoreMembers', 'callbacks'],
connection: function () { return signalR.hub; }
},
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.
EDIT: There was a bug in SignalR preventing /signalr/hubs to be correctly generated (it didn't generate the method stubs). https://github.com/SignalR/SignalR/issues/134
EDIT2: you could have a incorrect script tag, try:
<script src="@Url.Content("~/signalr/hubs")" type="text/javascript"></script>
or you haven't referenced the SignalR.AspNet.dll
assembly. If I recall correctly it's that assembly that wires up the route to /signalr.