<html>
<head>
<title>Dynamic CheckBox Sample</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void Page_Load ( object src, EventArgs e ) {
myLink.Visible = myCheckBox.Checked ? true : false;
myCheckBox.Text = myLink.Visible ? "Uncheck to Hide Text Link" : "Show Text Link";
}
void getAdProps ( object src, AdCreatedEventArgs e ) {
myLink.Text = e.AlternateText;
myLink.NavigateUrl = e.NavigateUrl;
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Dynamic CheckBox Sample</h2></div>
<!-- #include virtual="~/shared/viewsrc_top.inc" -->
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p><asp:checkbox id="myCheckBox" runat="server" autopostback /></p>
<p><asp:adrotator runat="server" height=140
advertisementfile="~/shared/books.xml"
bordercolor="silver" borderwidth=1
onAdCreated="getAdProps"
target="_blank" /></p>
<p><asp:hyperlink id="myLink" target="_blank" visible=false runat="server" /></p>
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>