如何在ASP.NET CheckBoxList控件中启用多选? [英] How to enable multi-selecting in ASP.NET CheckBoxList control?
问题描述
我一直在为此苦苦挣扎,有没有办法仅使用配置来做到这一点?
我是否必须手动处理带有回发的多重选择?
I've been struggling with this, is there a way to do it using just configuration? Do I necessarily have to handle multi-selection manually, with post-backs?
<asp:CheckBoxList ID="uxVisibilityScopeCheckBoxList" runat="server" AutoPostBack="false" />
此定义仅允许选中1个复选框。
This definition only allows 1 checkbox to be selected.
谢谢!
原来我们有一个 jscript 深入某个地方,这钩接到了所有 input [type = checkbox] 控件上,并且只允许选择同一组中的1个复选框。
Turns out we had a jscript somewhere deep, that was hooking to all of the input[type=checkbox] controls, and allowing to select only 1 checkbox of a same group.
要小心那些。
推荐答案
<asp:CheckBoxList id="check1" AutoPostBack="false"
TextAlign="Right" 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>
也请查看此链接
< a href = http://www.w3schools.com/aspnet/showasp.asp?filename=demo_checkboxlist rel = nofollow> http://www.w3schools.com/aspnet/showasp.asp?filename=demo_checkboxlist
这篇关于如何在ASP.NET CheckBoxList控件中启用多选?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!