zoukankan      html  css  js  c++  java
  • 获取checkboxlist选中的值以及绑定来自之前选中的来自数据库的值

                
    ///
    ///ps:一下几句都是一个意思,为的是以后有人搜索关键字的时候能定位到这里
    ///checkboxlist绑定选中值
    ///checkboxlist绑定来之mssql数据的值
    ///checkboxlist绑定来自之前选中的值
    ///checkboxlist绑定编辑选中值
    string strapp = "1,2,3"

    string[] strtemp = strapps.Split(','); foreach (string str in strtemp) { for (int i = 0; i < CheckBoxList1.Items.Count; i++) { if (this.CheckBoxList1.Items[i].Value == str) { this.CheckBoxList1.Items[i].Selected = true; } } }

    获取选中checkboxlist选中的值

               string funtext = string.Empty;
                for (int i = 0; i < CheckBoxList1.Items.Count; i++)
                {
                    if (CheckBoxList1.Items[i].Selected == true)
                    {
                        funtext += CheckBoxList1.Items[i].Value + ",";
    
                    }
                }

     转载请注明来源wikizhao

  • 相关阅读:
    萨卡斯指法
    香港保险
    数据分析,了解行业
    数据分析师
    黑盒测试方法
    web系统的常用功能测试
    linux-磁盘问题
    mysql连表查询
    mysql模糊查询
    MySQL 数据类型
  • 原文地址:https://www.cnblogs.com/whitehouse/p/3431895.html
Copyright © 2011-2022 走看看