Reputation: 300
I am trying to create a chat application but after successful build of the web app its catching an exception when i am passing the paramaters for chat.The exception is
0x800a139e - JavaScript runtime error: SignalR: Connection must be started before data can be sent. Call .start() before .send()
The screen shots are attached here
Upvotes: 0
Views: 383
Reputation: 15244
You need to make sure you don't try invoking server-side hub methods until start
is done
. Ex:
$.connection.hub.start().done(function(){
$('#submit').click(function () {
$.connection.chat.server.addMessage($('#msg').val());
})
});
Notice that the event handler isn't wired up until the connection is established.
Upvotes: 1