title: How to assign values from form to Javascript session variables
body: <p>I am trying to create Javascript Session variables that will read information from one form and pass these variables to another form. </p>
  
  <p>I can assign strings to these Session variables but i cannot assign values from Form elements to these variables</p>
  
  <pre><code>function SetUserName() 
  {       
       &lt;% var text1= "Charles";%&gt;
       &lt;%Session["UserName"] =text1;%&gt;
       var session_value='&lt;%=Session["UserName"]%&gt;';
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is the Javascript on the first page which works and on a button click i call another page where i can display this Session Variable.</p>
  
  <pre><code>function LoadUserName()
  {
      var username = '&lt;%= Session["UserName"] %&gt;';
      alert(username);
  }
  </code></pre>
  
  <p>This gets called on load of second page. How can i pass values from HTML elements to the Session Variable?</p>
  
  <p>For Example Say i have a Text Box </p>
  
  <pre><code> &lt;asp:TextBox ID="Address_Box" runat="server"  TextMode="MultiLine"
               MaxLength="200" &gt;&lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>How can I send the text from this box to the session variable?</p>