zoukankan      html  css  js  c++  java
  • CheckBoxList取值及勾选上

                string strrighgs = "";
                
    for (int i = 0; i < this.cblrighgs.Items.Count; i++)
                
    {
                    
    if (this.cblrighgs.Items[i].Selected == true)
                    
    {
                        strrighgs 
    += this.cblrighgs.Items[i].Value+"|";
                    }

                }


                
    string str = "";
                
    foreach (ListItem li in cblrighgs.Items)
                
    {
                    
    if (li.Selected == true)
                    
    {
                        str 
    += li.Value+";";
                    }

                }


                Response.Write(str);
                Response.End();
    勾选上:
                string[] strtemp = strapp.Split('|');
                
    foreach (string str in strtemp)
                
    {
                    
    for (int i = 0; i < cblrighgs.Items.Count; i++)
                    
    {
                        
    if (this.cblrighgs.Items[i].Value == str)
                        
    {
                            
    this.cblrighgs.Items[i].Selected = true;
                        }

                    }

                }
  • 相关阅读:
    0911内容。
    0909学习内容。
    0908学习内容
    第二天的学习内容
    第一天的学习内容
    学习目的
    jquery parents() next() prev() 找父级别标签 找同级别标签
    JQuery each遍历A标签获取href 和 里面指定的值
    jquery怎么实现点击一个按钮控制一个div的显示和隐藏
    谷歌浏览器(Chrome)禁止浏览器缓存 设置
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/751293.html
Copyright © 2011-2022 走看看