title: hub.statechange disconnects when changing page
body: <p>So I'm having a display issue and was wondering the best way to solve it. When the $.connection.hub.stateChanged event fires and it is in the disconnected state I display a dialog to the user saying connection lost. 
  But unfortunately when I change page this event is fired and displays the dialog before the page changes, displaying this error for a few seconds.</p>
  
  <p>Is the best way to disable the statechange event when I navigate to a different button? Or can i do somecheck in the event something like:</p>
  
  <pre><code>$.connection.hub.stateChanged(function (change) {
      if (change.newState === $.connection.connectionState.disconnected) {
          //Pseudo code:
          if (!pageIsChanging) {
              $('#lostConnectivityDiv').modal('show');
          }
      }
  });
  </code></pre>
  
  <p>or is there a jquery event for when the page change event is fired before the hub will be disconnected?</p>