标签归档:遍历

遍历页面上的所有控件

/// <summary>         /// 采用递归的方法来遍历页面控件         /// </summary>         /// <param name=”parent”></param>         protected void ErgodicChildrenControls(Control parent)         {             …


/// <summary>         /// 采用递归的方法来遍历页面控件         /// </summary>         /// <param name="parent"></param>         protected void ErgodicChildrenControls(Control parent)         {                         foreach (Control c in parent.Controls)             {                //此处写有关控件的代码,例如                   //if (c is HtmlInputButton)                // {                //    HtmlInputButton btn = (HtmlInputButton)c;                //   if (c.id =="save")               // {               //      c.Visble=true;               //     }                // }                  if (c.Controls.Count > 0)       // 判断该控件是否有下属控件。       ...... [阅读全文]