title: How to pass a parameter to hub in SignalR?
body: <p>My code in SignalR hub:</p>
  
  <pre><code>public class AlertHub : Hub
  {
      public static readonly System.Timers.Timer _Timer = new System.Timers.Timer();
  
      static AlertHub()
      {
          _Timer.Interval = 60000;
          _Timer.Elapsed += TimerElapsed;
          _Timer.Start();
      }
  
      static void TimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
      {
          //Random rnd = new Random();
          //int i = rnd.Next(0,2);
          Alert alert = new Alert();
          i = alert.CheckForNewAlerts(EmpId);
  
          var hub = GlobalHost.ConnectionManager.GetHubContext("AlertHub");
  
          hub.Clients.All.Alert(i);
      }
  }
  </code></pre>
  
  <p>Somehow I need to pass EmpId parameter.  How to accomplish this?</p>
  
  <p><strong>Some more client details:</strong>
  On my aspx page I have the following code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  
      $(function () {
          var alert = $.connection.alertHub;
          alert.client.Alert = function (msg) {
              if (msg == 1) {
                  $("#HyperLink1").show();
                  $("#HyperLink2").hide();
  
              }
              else {
                  $("#HyperLink1").hide();
                  $("#HyperLink2").show();
              }
              //$("#logUl").append("&lt;li&gt;" + msg + "&lt;/li&gt;");
          };
          $.connection.hub.start();
      });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>On ASPX page, my EmpID is in the session object and I need to somehow use it in the SignalR hub.  </p>