Add
runat="server"
and
ClientIDMode="Static"
to your
<input>
tag:
<input id="hidden" type="hidden" runat="server" ClientIDMode="Static" />
This will make the input a server control (an
System.Web.UI.HtmlControls.HtmlInputHidden
), which will automatically preserve its value on postback.
(You need the ClientIDMode="Static"
attribute to prevent ASP.NET from changing the control's ID when it's rendered.)
To reload the page, you just need to submit the form. Depending on what controls you have on your page, you might have a javascript function called
__doPostBack
which will do the job. Otherwise, you'll just need to find the form element and call its
submit
method.