在页面控件的外层 写一个 form 把这些控件包进去
终于出来了 。。。 没有写过这样的代码
protected void Button1_Click1(object sender, EventArgs e)
{
int nPageControls = Page.Controls.Count;
for (int i = 0; i < nPageControls; i++)
{
foreach (System.Web.UI.Control aa in Page.Controls[i].Controls)
{
if ( aa is TextBox)
{
TextBox tb = (TextBox)aa;
tb.Text = "hello world!";
//Page.ClientScript.RegisterStartupScript(this.GetType(), "1", "alert(hello)");
}
}
}
}
没按按钮吧