<html>
<head>
<title>Using the HtmlForm Control for Postback Requests</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<style type="text/css">
<!--
button { font:bold 9pt; width:75; padding:3;
background:maroon; color:khaki }
-->
</style>
<script language="C#" runat="server">
void getBook ( object src, EventArgs e ) {
string id = ( ( HtmlButton ) src ) .ID;
book.KeywordFilter = id;
book.Visible = true;
string txt = ( ( HtmlButton ) src ) .InnerText == "C#" ?
"C sharp" : ( ( HtmlButton ) src ) .InnerText;
msg.Text = "<a href='http://www.amazon.com/exec/obidos/external-search?mode=books&keyword=" +
txt + "&tag=rvnunz0525-20' target='_blank'>Check out other " +
( ( HtmlButton ) src ) .InnerText + " books at Amazon</a>";
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Using the <span class="hilite">HtmlForm</span> Control for Postback Requests</h2></div>
<!-- #include virtual="~/shared/viewsrc_top.inc" -->
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<table>
<tr>
<td>
<button id="aspnet" runat="server" onServerClick="getBook">ASP.NET</button>
<button id="adonet" runat="server" onServerClick="getBook">ADO.NET</button>
<button id="csharp" runat="server" onServerClick="getBook">C#</button>
<button id="vbnet" runat="server" onServerClick="getBook">VB.NET</button>
<button id="xml" runat="server" onServerClick="getBook">XML</button>
</td>
</tr>
</table>
<p><asp:adrotator id="book" runat="server"
advertisementfile="~/shared/books.xml"
bordercolor="silver" borderwidth=1
target="_blank" height=140 />
<p><asp:label id="msg" runat="server"
text="Click on any of the above buttons to check out other books." />
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>