获取页面得所有控件

for (int i = 0; i < Page.Controls.Count; i++)
        {
            foreach (System.Web.UI.Control control in Page.Controls[i].Controls)
            {
               
                if (control is TextBox)
                {
                    (control as TextBox).Text  = "textbox";
                }
                else if(...)

                     //and also
            }
        }

posted @ 2011-02-22 14:10  郑文亮  阅读(381)  评论(0编辑  收藏  举报