title: How to include Session variable in NavigateUrl in hyperlink
body: <p>I'm sure I've done this before, but can't remember the syntax. How do I include a session variable in nagivateUrl in a hyperlink?</p>
  
  <p>I've tried this:</p>
  
  <pre><code>&lt;asp:HyperLink ID="lnkMyLink" runat="server" Text="My Link" 
   NavigateUrl='&lt;%# "http://absoluteURL.org?param=" +
   Session["myParameterValue"].ToString()%&gt;'&gt;&lt;/asp:HyperLink&gt;
  </code></pre>
  
  <p>and this:</p>
  
  <pre><code>&lt;asp:HyperLink ID="lnkMyLink" runat="server" Text="My Link" 
   NavigateUrl='&lt;%# String.Format("http://absoluteURL.org?param={0}",
   Session["myParameterValue"].ToString()) %&gt;'&gt;&lt;/asp:HyperLink&gt;
  </code></pre>