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