title: Hidden value assigned in js lost after postback
body: <p>Here's my problem. I have a hidden field whose value I change through a javascript method. The problem is after postback the value is lost.</p>
  
  <p>How can I persist the value after postback?</p>
  
  <p>Thanks!</p>
  
  <p>.aspx File</p>
  
  <pre><code>&lt;asp:HiddenField ID="HiddenField1" runat="server" /&gt;
  &lt;asp:Button ID="BtnGuardar" runat="server" OnClick="BtnGuardar_Click" OnClientClick="return GridUpdateInfoOK()" /&gt;
  </code></pre>
  
  <p>.js file</p>
  
  <pre><code>document.getElementById('&lt;%= HiddenField1.ClientID %&gt;').value = 'TEST';
  </code></pre>
  
  <p>.aspx.cs file</p>
  
  <pre><code>protected void BtnGuardar_Click(object sender, EventArgs e)
  {
      String test = HiddenField1.Value;
  }
  </code></pre>