<head>
<title>HtmlInputRadioButton Control Example</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
string [ ] answers = {
"Abraham Lincoln came a tad bit later.",
"Christopher Columbus was an explorer, <br>not a United States President.",
"Correct. George Washington was the first President <br>of the United States of America.",
"Robert Plant was the lead vocalist of Led Zeppelin, <br>not a United States President."};
void chkAnswer ( object src, EventArgs e ) {
string txt = "";
if ( Radio1.Checked )
txt += answers [ 0 ];
else if ( Radio2.Checked )
txt += answers [ 1 ];
else if ( Radio3.Checked )
txt += answers [ 2 ];
else if ( Radio4.Checked )
txt += answers [ 3 ];
msg.InnerHtml = txt;
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2><span class="hilite">HtmlInputRadioButton Control</span> Example</h2></div>
<hr size=1 width=92%>
<div align="center">
<form runat="server">
<p><b>The first president of the United States was:</b></p>
<table width=300 cellpadding=5 bgcolor="beige" style="border:1px inset">
<tr><td><label><input type=radio id="Radio1" name="choices"
runat="server">Abraham Lincoln</label></td></tr>
<tr><td><label><input type=radio id="Radio2" name="choices"
runat="server">Christopher Columbus</label></td></tr>
<tr><td><label><input type=radio id="Radio3" name="choices"
runat="server">George Washington</label></td></tr>
<tr><td><label><input type=radio id="Radio4" name="choices"
runat="server">Robert Plant</label></td></tr>
</table>
<p><button onServerClick="chkAnswer" runat="server">Submit</button>
<p id="msg" runat="server" />
</form>
</div>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>