📄 ch08-03-05.aspx
字号:
<Html>
<Head>
<Title>Ch08-03-05.aspx Web控件的CheckBoxList控件</Title>
<Script Language="VB" Runat="Server" >
' 用户单击“确定”按钮的事件处理程序
Sub Button_Click(obj As Object, e As EventArgs)
Dim strA As String
Dim I as Integer
For I = 0 To Peripheral.Items.Count-1
If Peripheral.Items(I).Selected = True Then
strA = strA & Peripheral.Items(I).Text & "<BR>"
End If
Next
strA = "可以让计算机运作的基本配置为:1.键盘、" & _
"2.液晶显示器、5.鼠标<BR>" & _
"用户选择:<BR>" & strA
Show1.InnerHtml = strA
End Sub
</Script>
</Head>
<Body>
<Form Runat="Server">
请选择可以让计算机运作的基本配置:<Br>
<asp:CheckBoxList ID="Peripheral" RepeatDirection="Horizontal"
RepeatLayout="Flow" Runat="Server" >
<asp:Listitem Text="键盘" Value="1" Selected="True" />
<asp:Listitem Text="液晶显示器" Value="2" />
<asp:Listitem Text="喷墨打印机" Value="3" />
<asp:Listitem Text="激光打印机" Value="4" />
<asp:Listitem Text="鼠标" Value="5" />
<asp:Listitem Text="音箱" Value="6" />
</asp:CheckBoxList>
<Input Type="Button" ID="Button" Value="确定" Runat="Server"
OnServerClick="Button_Click" /><P>
</Form>
<Span ID="Show1" Runat="Server"></Span>
</Body>
</Html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -