Set Session in codebehind for an Onclick
<p>How can i add Session value in codebehind. I have tried doing it this way but the session does nt have any value. </p>

<pre><code> x is string.
 td1.InnerHtml = "&lt;a href=\"Search.aspx\" onClick=\"Session['catvalue']=" + x + "\"&gt;" + x +&lt;/a&gt; 
</code></pre>

<p>Thank you in advance!</p>
