title: How to receive broadcast message from Hub class in SignalR client using C#?
body: <p>I have a scenario where one of the clients is sending a request to Hub Class method <code>AddMessage</code>, which in turn should broadcast that message to all clients including the one who initiated it.</p>
  
  <p>The problem is that I am able to call the Hub method <code>AddMessage</code> from the client as shown in the following code, but I couldn't find a way to handle the broadcast message on the client side which is initiated in the Hub class using the following line.</p>
  
  <pre><code>Clients.All.NotifyMessageToClients(name, message);
  </code></pre>
  
  <p><em>SignalR Hub Class</em></p>
  
  <pre><code>using System;
  using Microsoft.AspNet.SignalR;
  using System.Threading.Tasks;
  
  public class SignalRChatHub : Hub
  {
      public void AddMessage(string name, string message)
      {
          // Following call is supposed to notify all clients with passed parameters. 
          // They could have a method called NotifyMessageToClients to fetch the broadcasted message
  
          Clients.All.NotifyMessageToClients(name, message); 
      }
  }
  </code></pre>
  
  <p><em>SignalR Client</em></p>
  
  <pre><code>using System;
  using Microsoft.AspNet.SignalR.Client;
  
  public partial class Default : System.Web.UI.Page
  {
      HubConnection hubConnection;
      IHubProxy stockTickerHubProxy;
  
      public Default()
      {
          hubConnection = new HubConnection("http://localhost:6898/");
          stockTickerHubProxy = hubConnection.CreateHubProxy("SignalRChatHub");
      }
  
      async public void SendAddNotification(string msgFrom, string msg)
      {
          // Following line calls Addmessage method in SignalRChatHub class
          await stockTickerHubProxy.Invoke("Addmessage", "Ajendra", "Hello StackOverflow");
      }
  
      // I might need the method NotifyMessageToClients here... to receive broadcasted message
  }
  </code></pre>
  
  <p>I have some idea about how to achieve the same in jQuery but not in C# by creating a client as I did above. How would I achieve this?</p>
  
  <p>If the above approach doesn't make sense in any way, please suggest me the right one.</p>