title: Create session variable onclick hyperlink field asp.net c#
body: <p>I am writing <code>asp.net</code> project in <code>C#</code>, my page consists of <code>hyperlink</code> field inside <code>gridview</code>. 
  The code is below:</p>
  
  <pre><code>&lt;asp:TemplateField&gt;
     &lt;ItemTemplate&gt;
         &lt;asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='details.aspx' Text="view details"&gt;&lt;/asp:HyperLink&gt;
     &lt;/ItemTemplate&gt;
  &lt;/asp:TemplateField&gt;
  </code></pre>
  
  <p>I want to handle <code>onclick</code> event on this <code>hyperlink</code> field, so that when I click on it I go to the new page and create new session variable. 
  So how to create session variable and go to the new page on click of a <code>hyperlink</code>? Thanks!</p>