title: SignalR push-notification to specific client with MVC4
body: <p>I am trying to use SignalR with MVC4 c# project to send push notification to selected clients only.
  For this I am using 'context.Clients.Client' by storing 'Context.ConnectionId' in c# static variable {since unable to use session with signalr}.
  But since 'contextConnectionId' is a static variable; the message is still boardcasted to all clients :(</p>
  
  <p>Is there any alternative to session with signal or any other elegant way to do this? (found few related post but no specific answers)</p>
  
  <p>Code as below: </p>
  
  <p>javaScript</p>
  
  <pre><code> $(document).ready(function (){
   {
      var chat = $.connection.PushNotify;
      chat.client.addNewMessageToPage = function (type, message) {
          if(type == "something")
          {
              alert(message);
          }
      }
      // Start the connection.
      $.connection.hub.start().done(function () {
          chat.server.send($('').val(), $('').val());
      });
   )}
  </code></pre>
  
  <p>In c# HUB</p>
  
  <pre><code>[HubName("PushNotify")]
  public class PushNotify : Hub
  {
      public void Send(string name, string message)
      {
          //assume its c# static variable
          GlobalVariable.contextConnectionId = Context.ConnectionId;
      }
  }
  public class PushNotification
  {
      public void SendMessage(string message, string type = "msg")
      {
          if (!string.IsNullOrEmpty(GlobalVariable.contextConnectionId))
          {
              var context = GlobalHost.ConnectionManager.GetHubContext&lt;PushNotify&gt;();
              context.Clients.Client(GlobalVariable.contextConnectionId).addNewMessageToPage(type, message);
          }
  
      }
  }
  </code></pre>