<script runat="server">
Sub submit(Sender As Object, e As EventArgs)
if red.Checked then
Label1.Text="You selected " & red.Text
elseIf green.Checked then
Label1.Text="You selected " & green.Text
elseIf blue.Checked then
Label1.Text="You selected " & blue.Text
end if
End Sub
</script>
<!DOCTYPE html>
<html>
<body>
<form runat="server">
Select your favorite color:
<br>
<asp:RadioButton id="red" Text="Red" Checked="True"
GroupName="colors" runat="server"/>
<br>
<asp:RadioButton id="green" Text="Green"
GroupName="colors" runat="server"/>
<br>
<asp:RadioButton id="blue" Text="Blue"
GroupName="colors" runat="server"/>
<br>
<asp:Button text="Submit" OnClick="submit" runat="server"/>
<p><asp:Label id="Label1" runat="server"/></p>
</form>
</body>
</html>