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

                    }

                }
  • 相关阅读:
    用对象模式实现QTP的远程调用
    Python 常用类库
    User32.dll 函数的相关方法整理
    python ConfigParser – 配置文件解析
    python 中的 __init__()解释
    Access to the database file is not allowed. [ File name = ***\DataBase.sdf
    在遗忘中成长
    在MVC3里如何关闭Form标签
    javascript 中写cookie
    .NET之死和观念的力量【】
  • 原文地址:https://www.cnblogs.com/cnaspnet/p/751293.html
Copyright © 2011-2022 走看看