<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 ShowHideImage ( 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="ShowHideImage"/></p>
<p><img id="image" runat="server"
src="/shared/images/earth.gif"
width="200" border=0
title="Save our Planet" visible=false />
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>