读书人

CheckBoxList抉择其中一项其他自动清空

发布时间: 2012-07-25 09:43:06 作者: rapoo

CheckBoxList选择其中一项其他自动清空
前台:
附件情况:<asp:CheckBoxList ID="CheckBoxList3" runat="server">
</asp:CheckBoxList>
后台绑定数据(很多,这里只列举几项):
1.耳机 2.电池 3.充电器 4.无
实现:选择“无”的时候,自动清空前面已经选中的,如何实现?

[解决办法]
要无刷新的改成这样:

HTML code
    <form id="form1" runat="server">    <asp:ScriptManager ID="ScriptManager1" runat="server">    </asp:ScriptManager>    <asp:UpdatePanel ID="UpdatePanel1" runat="server">        <ContentTemplate>            <asp:CheckBoxList ID="CheckBoxList3" runat="server" AutoPostBack="True" OnSelectedIndexChanged="CheckBoxList3_SelectedIndexChanged">                <asp:ListItem>耳机</asp:ListItem>                <asp:ListItem>充电器</asp:ListItem>                <asp:ListItem>电池</asp:ListItem>                <asp:ListItem>无</asp:ListItem>            </asp:CheckBoxList>        </ContentTemplate>    </asp:UpdatePanel>    </form> 

读书人网 >asp.net

热点推荐