Assign value to session using javascript
<p>I use this JavaScript function:</p>

<pre><code>function Test()
{
    var myvar =document.getElementById('Text1').value;
    '&lt;%Session["test"] = "' + myvar +'"; %&gt;' ;
    var sessionValue =  '&lt;%= Session["test"].ToString() %&gt;';
    alert(sessionValue);
}
</code></pre>

<p>This works fine but when I try to access the session value from the server</p>

<pre><code>string a = Session["test"].ToString();
</code></pre>

<p>the value will be <code>a = "'+myvar+'"</code></p>

<p>What did I do wrong?</p>
