rt

解决方案 »

  1.   


    foreach (Control ctrlTemp in this.Controls)
    {
    if (ctrlTemp.GetType().Name == "CheckBoxlist")
    {
    ;
    }
    }
      

  2.   

    foreach (Control ctrlTemp in this.Controls)
                {
                    if (ctrlTemp.GetType().Name == "CheckBoxList")
                    {
                        dm.SetModelValue(type, "TypeName", (ctrlTemp as CheckBoxList).ToolTip);
                        Dictionary<string, string> key = new Dictionary<string, string>();
                        key.Add("ParentId", type.Code);
                        (ctrlTemp as CheckBoxList).DataSource = dm.GetDataTableDese(type, key, 30, "Code");
                        (ctrlTemp as CheckBoxList).DataBind();
                    }
                }
    不对啊 If语句根本就不进去啊
      

  3.   

    我都是用panel存放控件,临时改了一下
    foreach (Control ctrlTemp in Panel1.Controls)
      

  4.   

    哎呀,来迟了一步,foreach (Control con in this.Page.Controls)
      {
      if (con.GetType() = typeof(LinkButton))
      {
      //如果控件是LinkButton
      }
      }
      

  5.   

    怎么放?我用了Checkboxlist list = {this.checkboxlist1,this.checkboxlist2};
    他报错
      

  6.   

    我加了个panel 读是读出来了 为什么第一个就不显示呢?我打断点看了下 第一次If没有进去 怎么回事...
      

  7.   

    this.Controls 改成 page试试