保存复选框值 [英] to save checkbox values

查看:106
本文介绍了保存复选框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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 
            }
        }


这篇关于保存复选框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆