保存复选框值

编程入门 行业动态 更新时间:2024-10-27 14:26:41
本文介绍了保存复选框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经创建了一个复选框.当我选中此复选框时,我希望将其保存.有人可以向我提出一些想法吗?

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> &nbsp; </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 } }

更多推荐

保存复选框值

本文发布于:2023-11-06 16:02:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1564152.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:复选框

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!