title: How to call a hub method from c#
body: <p>I'm trying to do a small signalR sample to understand it. But i got stuck and not able to get the output.</p>
  
  <p>Here is my sample code</p>
  
  <pre><code>public class HubClass : Hub
  {
      public void HubMethod(string myMessage)
      {
          Clients.All.hubClient(myMessage);
      }
  }
  
  public ActionResult Index()
  {
      var hubContext = GlobalHost.ConnectionManager.GetHubContext&lt;HubClass&gt;();
      hubContext.Clients.All.HubMethod("Hello");
      return View();
  }
  
  &lt;div class="msg"&gt;&lt;/div&gt;
  &lt;script src="~/Scripts/jquery.signalR-2.1.2.min.js"&gt;&lt;/script&gt;
  &lt;script src="~/signalr/hubs"&gt;&lt;/script&gt;
  &lt;script&gt;
      var hubCls = $.connection.hubClass;
      $.connection.hub.start();
      hubCls.client.hubMethod = function (message) {
          $('.msg').text(message);
      };
  &lt;/script&gt;
  </code></pre>
  
  <p>I don't know where I'm doing wrong</p>