案例:ASP.NET案例     状态:不可编辑再运行    进入竖版
 运行结果 
x
 
1
2
<script  runat="server">
3
Sub Check(sender As Object, e As EventArgs)
4
   dim i
5
   mess.Text="<p>Selected Item(s):</p>"
6
   for i=0 to check1.Items.Count-1
7
     if check1.Items(i).Selected then
8
       mess.Text+=check1.Items(i).Text + "<br />"
9
     end if
10
   next
11
End Sub
12
</script>
13
14
<html>
15
<body>
16
17
<form runat="server">
18
<asp:CheckBoxList id="check1" AutoPostBack="True"
19
TextAlign="Right" OnSelectedIndexChanged="Check"
20
runat="server">
21
<asp:ListItem>Item 1</asp:ListItem>
22
<asp:ListItem>Item 2</asp:ListItem>
23
<asp:ListItem>Item 3</asp:ListItem>
24
<asp:ListItem>Item 4</asp:ListItem>
25
<asp:ListItem>Item 5</asp:ListItem>
26
<asp:ListItem>Item 6</asp:ListItem>
27
</asp:CheckBoxList>
28
<br />
29
<asp:label id="mess" runat="server"/>
30
</form>
31
32
</body>
33
</html>
34