陈斌彬的技术博客

Stay foolish,stay hungry

获取页面得所有控件

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