<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="test" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
What is your favorite ice cream flavor?
<br />
<br />
<asp:RadioButton ID="A" GroupName="flavors" runat="server" Text="A" /><br />
<br />
<asp:RadioButton ID="B" GroupName="flavors" runat="server" Text="B" /><br />
<br />
<asp:RadioButton ID="C" GroupName="flavors" runat="server" Text="C" /><br />
<br />
<asp:Button ID="btnSubmit" runat="server" Text="Click Me" /><br />
<br />
<asp:Label ID="results" runat="server"></asp:Label></div>
</form>
</body>
</html>
File: Default.aspx.vb
Partial Class test
Inherits System.Web.UI.Page
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
If A.Checked Then
results.Text = "A"
ElseIf B.Checked Then
results.Text = "B"
ElseIf C.Checked Then
results.Text = "C"
End If
End Sub
End Class
|