<head>
<title>Responding to a User Selection in a RadioButton Group</title>
<link rel="stylesheet" href="/shared/netdemos.css">
<script language="C#" runat="server">
void getSelected ( object src, EventArgs e ) {
string msg = "This option installs ";
if ( Radio1.Checked ) {
msg +="the features most typically used. <p><i>Requires 1.2 MB disk space.</i>";
}
else if ( Radio2.Checked ) {
msg +="the minimum files required to run the product. <p><i>Requires 350 KB disk space.</i>";
}
else if ( Radio3.Checked ) {
msg +="all features for the product. <p><i>Requires 4.3 MB disk space.</i>";
}
msg.Text = msg;
}
</script>
</head>
<body>
<!-- #include virtual="~/shared/top.inc -->
<div class="header"><h2>Responding to a User Selection in a RadioButton Group</h2></div>
<!-- #include virtual="~/shared/viewsrc_top.inc" -->
<hr size=1 width=92%>
<form runat="server">
<h5>Select the type of installation you wish to perform:</h5>
<table cellpadding=10>
<tr valign="top">
<td>
<asp:RadioButton id="Radio1" Text="Typical" GroupName="RadioGroup1" onCheckedChanged="getSelected" autopostback runat="server" /><br>
<asp:RadioButton id="Radio2" Text="Compact" GroupName="RadioGroup1" onCheckedChanged="getSelected" autopostback runat="server" /><br>
<asp:RadioButton id="Radio3" Text="Full" GroupName="RadioGroup1" onCheckedChanged="getSelected" autopostback runat="server" /><br>
</td>
<td><asp:Label id="msg" runat="server" /></td></tr>
</table>
</form>
<hr size=1 width=92%>
<!-- #include virtual="~/shared/viewsrc.inc" -->
</body>
</html>