title: Detect if session expired using javascript
body: <p><br>
  I am creating a web application using ASP.Net. I am using session in my application.
  <br>
  There is one scenario where I am trying to access session variable through Javascript. It is working fine, when I m accessing it in normal state. But after session expiry, if click on any button, it throws exception and behaves abnormally, resulting in page not found.
  <br>Here is the code I am using; <br></p>
  
  <pre><code> var TransactionID = '&lt;% =((Hashtable)(Session["SessionData"]))["TransactionID "] %&gt;';
   if(TransactionID !='')
   {
      //action
   }
  </code></pre>
  
  <p>I am trying to achieve something like of sort in c#;</p>
  
  <pre><code>String lsStr;
  if(null != lsStr)
  {
      //action
  }
  </code></pre>
  
  <p>Please help me, if anyone knows how to check if session exists or not using javascript.
  <br>
  Thanks in advance.</p>