title: Why SignalR Client Methods are not firing everytime?
body: <p>I am writing an ASP.NET Web Form Application with a chat form using SignalR and Jquery.
  The Hub Has Methods like,</p>
  <pre><code>public void SendMessage(string empid, string empName, string message, string time)
      {
          
          Clients.All.messageBroadcasted(empid, userName, message, time);
  
      }
  </code></pre>
  <p>and in the javascript file,</p>
  <pre><code>$(document).on('click', '#btnSendMsg', function () {
  var hub = $.connection.myChat;
  var msg = $(&quot;#txtMessage&quot;).val();
  if (msg.length &gt; 0) {
      var empid = &quot;1&quot;;
      var empname = &quot;user1&quot;;
      var date = new Date();
      hub.server.sendMessage(empid, empname, msg, date);
      $(&quot;#txtMessage&quot;).val('');
  }  })
  </code></pre>
  <p>and the client method,</p>
  <pre><code>myHub.client.messageBroadcasted = function (empid, empName, message, time) { 
     
      AppendMessage(empid, empName, message, time);
  }
  </code></pre>
  <p>Now, the problem is the the client method <code>myHub.client.messageBroadcasted</code> is not firing everytime.
  Sometimes <code>AppendMessage</code> happens, sometimes not. But the hub class is being hit everytime.</p>
  <p>Any help would be very appreciated.</p>
  <p><strong>EDIT:</strong> I solved it by registering events before starting the hub!</p>