ASP.NET HTML 控件 CheckboxList
asp.net html 控件 checkboxlist
<script runat="server">
sub check(sender as object, e as eventargs)
dim i
mess.text="<p>selected item(s):</p>"
for i=0 to check1.items.count-1
if check1.items(i).selected then
mess.text+=check1.items(i).text + "<br>"
end if
next
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<asp:checkboxlist id="check1" autopostback="true"
textalign="right" onselectedindexchanged="check"
runat="server">
<asp:listitem>item 1</asp:listitem>
<asp:listitem>item 2</asp:listitem>
<asp:listitem>item 3</asp:listitem>
<asp:listitem>item 4</asp:listitem>
<asp:listitem>item 5</asp:listitem>
<asp:listitem>item 6</asp:listitem>
</asp:checkboxlist>
<br>
<asp:label id="mess" runat="server"/>
</form>
</body>
</html>
sub check(sender as object, e as eventargs)
dim i
mess.text="<p>selected item(s):</p>"
for i=0 to check1.items.count-1
if check1.items(i).selected then
mess.text+=check1.items(i).text + "<br>"
end if
next
end sub
</script>
<!doctype html>
<html>
<body>
<form runat="server">
<asp:checkboxlist id="check1" autopostback="true"
textalign="right" onselectedindexchanged="check"
runat="server">
<asp:listitem>item 1</asp:listitem>
<asp:listitem>item 2</asp:listitem>
<asp:listitem>item 3</asp:listitem>
<asp:listitem>item 4</asp:listitem>
<asp:listitem>item 5</asp:listitem>
<asp:listitem>item 6</asp:listitem>
</asp:checkboxlist>
<br>
<asp:label id="mess" runat="server"/>
</form>
</body>
</html>
相关文章
- ASP.NET Web Pages 布局
- ASP.NET Web Pages – 发布
- ASP.NET Razor 语法
- ASP.NET MVC 页面和布局
- ASP.NET MVC 视图
- ASP.NET Repeater 控件
- ASP.NET 数据库连接
- ASP.NET 实例
- ASP.NET CompareValidator 控件
- ASP.NET AdRotator 控件
- ASP.NET DropDownList 控件
- ASP.NET ListBox 控件
- ASP.NET RadioButtonList 控件
- ASP.NET Table 控件
- ASP.NET TableCell 控件
- ASP.NET TableRow 控件
- WebSecurity CurrentUserName 属性
- WebSecurity ConfirmAccount 方法
- WebSecurity CreateAccount 方法
- AdRotator