<head>
<title>Responding to Changes in a TextBox Web Control</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void setLabelText ( object src, EventArgs e ) {
msg.Text = myTextBox.Text;
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Responding to Changes in a TextBox Web Control</h2></div>
<!-- #include virtual="~/shared/viewsrc_top.inc" -->
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p><asp:textbox id="myTextBox" width="200px" runat="server"
onTextChanged="setLabelText" autopostback />
<p><b><asp:label id="msg" runat="server"
text="Type some text into the box and press Enter." /></b>
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>