title: ASP.NET hidden field not updating after postback
body: <p>I  have some code on my ASP page which looks like this:</p>
  
  <pre><code>&lt;asp:UpdatePanel runat="server" id="updatepanel1" UpdateMode="Conditional" onload="updatepanel1_Load" ChildrenAsTriggers="false"&gt;
  &lt;ContentTemplate&gt;
  &lt;asp:HiddenField id="sendingRequest" runat="server" Value="0" /&gt;
  ....
  &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>I also have some javascript on my page which does this, to trigger the update of the updatepanel:</p>
  
  <pre><code>var sendingRequest = document.getElementById("&lt;%=sendingRequest.ClientID%&gt;");
  sendingRequest.value = "1";
  __doPostBack('&lt;%= updatepanel1.ClientID %&gt;', '');
  </code></pre>
  
  <p>Everything works fine up to now, but in my updatepanel1_Load event, I try to set the value back to "0" :</p>
  
  <pre><code>sendingRequest.Value = "0";
  </code></pre>
  
  <p>This value never gets updated and set back to 0 on the client after the postback, and I can't figure out why!</p>
  
  <p>Can anyone help? Thanks</p>