|
<%@ Page Language="VB" %>
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Label1.Text = ""
' Reset error message
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs)
If CheckBox1.Checked Then
Label1.Text = "You know <b>ASP.NET</b>! <br>"
Label1.Text &= "Your level is <b><i>" & _
RadioButtonList1.SelectedItem.Value & "</i></b>!"
Else
Label1.Text = "You do not know <b>ASP.NET</b>!"
End If
End Sub
Private Sub CheckBox1_CheckedChanged (ByVal sender As System.Object, ByVal e As
System.EventArgs)
Panel1.Visible = Not Panel1.Visible
End Sub
</script>
<html><head>
<title>RadioButton</title>
</head>
<body>
<form id="Form1" method="post" runat="server">
<p>
<asp:CheckBox id="CheckBox1" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged"
Text="I know ASP.NET!" AutoPostBack="True"></asp:CheckBox>
</p>
<p>
<asp:Panel id="Panel1" runat="server" Width="249px" Height="147px" BorderStyle="Ridge"
Visible="False">
<p>
<strong> Level of expertise:</strong>
</p>
<p></p>
<p>
<asp:RadioButtonList id="RadioButtonList1" runat="server" Font-Bold="True">
<asp:ListItem Value="Basic" Selected="True">Basic</asp:ListItem>
<asp:ListItem Value="Intermediate">Intermediate</asp:ListItem>
<asp:ListItem Value="Expert">Expert</asp:ListItem>
</asp:RadioButtonList>
</p>
</asp:Panel>
</p>
<p>
</p>
<p>
<asp:Button id="Button1" onclick="Button1_Click" runat="server" Text="Submit"></asp:Button>
</p>
<p>
<asp:Label id="Label1" runat="server"></asp:Label>
</p>
<p>
</p>
</form>
</body>
</html>
|