本文介绍了保存复选框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个复选框.当我选中此复选框时,我希望将其保存.有人可以向我提出一些想法吗?
I have created a check box.when I check this checkbox I want this to get saved.Can some one suggest me some ideas
<td> <asp:CheckBoxList ID="CheckBoxList1" runat="server" Width="227px" Style="margin-left: 0px"> <asp:ListItem>xx</asp:ListItem> <asp:ListItem>yy</asp:ListItem> <asp:ListItem>zz</asp:ListItem> </asp:CheckBoxList> </td>推荐答案
hi foreach (ListItem li in CheckBoxList1.Items) { if (li.Selected == true) { //your code is here Response.Write("<script>alert('"+li.Text +"')</script>"); } }
你好 hello foreach(ListItem li in CheckBoxList1.Items) { if(li.Selected == true) { //Write here your code for saving } }
更多推荐
保存复选框值
发布评论