title: Cannot read property 'notificationHub' of undefined
body: <p>I am working to get notification in my MVC app using SignalR but I am getting below error  <strong>Cannot read property 'notificationHub' of undefined</strong> while debugging on browser at last line of code</p>
  
  <pre><code> public class NotificationHub : Hub
      {
          //public void Hello()
          //{
          //    Clients.All.hello();
          //}
      }
  
  
  
  private void SqlDep_OnChange(object sender, SqlNotificationEventArgs e)
          {
              if (e.Type == SqlNotificationType.Change)
              {
                  SqlDependency sqlDep = sender as SqlDependency;
                  var notificationHub = GlobalHost.ConnectionManager.GetHubContext&lt;NotificationHub&gt;();
                  notificationHub.Clients.All.notify("added");
                  RegisterNotification(DateTime.Now);
              }
          }
  
   &lt;script src="~/Scripts/jquery-3.1.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="~/Scripts/jquery.signalR-2.2.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="/signalr/hubs" &gt;&lt;/script&gt;
      &lt;script src="~/Scripts/bootstrap.min.js"&gt;&lt;/script&gt;
  
   var notificationHub = $.connection.notificationHub;
  </code></pre>