<html>
<head>
<title>WebControl Enabled Property</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void Page_Load ( Object src, EventArgs e ) {
myEmail.Enabled = join.Checked ? true : false;
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc" -->
<div class="header"><h2>Dynamically Setting the Enabled Property of a Web Control</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p><asp:checkbox id="join" autopostback runat="server"
text="Join mailing list" /></p>
<p><b>Please enter your e-mail address</b>: </p>
<p><asp:textbox id="myEmail" size="25"
text="someone@where.com" runat="server" /></p>
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>