遍历 web页面控件

 protected void GetChildControl(Control ParentControl)
      {
          if (ParentControl.HasControls())
          {
              foreach (Control ctl in ParentControl.Controls)
              {
                  if (ctl.GetType().ToString() == "System.Web.UI.WebControls.TextBox")
                      ((System.Web.UI.WebControls.TextBox)ctl).Text = "分";

                  GetChildControl(ctl);
              }
          }
      }
     

原文地址:https://www.cnblogs.com/tongdengquan/p/6090648.html