<html>
<head>
<title>HtmlInputHidden Control Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void Page_Load ( object src, EventArgs e ) {
if ( Page.IsPostBack ) {
msg.InnerHtml = "Saved previous value: <b>" + hiddenField.Value + "</b>";
}
}
void submitHandler ( object src, EventArgs e ) {
hiddenField.Value = myText.Value;
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2><span class="hilite">HtmlInputHidden Control</span> Example</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<input type=hidden id="hiddenField" value="Initially none. Click again." runat="server">
<p>Enter a string: <input id="myText" type=text size=30 runat="server">
<input type=submit value="Enter" onServerClick="submitHandler" runat="server">
<p id="msg" runat="server">This label will display the previously entered string.</p>
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>