<html>
<head>
<title>Dynamic HtmlAnchor Sample</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void Page_Load ( object src, EventArgs e ) {
// initialize link text
if ( !IsPostBack ) {
showhideLink.InnerText = image.Visible ? "Hide Image" : "Show Image";
}
}
void ShowHideAd ( object src, EventArgs e ) {
image.Visible = image.Visible ? false : true;
showhideLink.InnerText = image.Visible ? "Hide Image" : "Show Image";
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Dynamic <span class="hilite">HtmlAnchor</span> Sample</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p><a id="showhideLink" runat="server" onServerClick="ShowHideAd"/></p>
<table id="image" cellpadding=3 visible=false runat="server">
<tr><td>
<asp:adrotator runat="server" height=140
advertisementfile="~/shared/books.xml"
bordercolor="silver" borderwidth=1
target="_blank" />
</td></tr>
</table>
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>