public void test()
{
foreach(System.Web.UI.Control cc in this.Controls)
{
if(cc.HasControls())
{
foreach(System.Web.UI.Control con in cc.Controls)
{
Response.Write(con.UniqueID.ToString());
if(con is System.Web.UI.WebControls.TextBox)
{
System.Web.UI.WebControls.TextBox tb=(System.Web.UI.WebControls.TextBox)con;
tb.Text="nihao";
}
}
}
}
}
{
foreach(System.Web.UI.Control cc in this.Controls)
{
if(cc.HasControls())
{
foreach(System.Web.UI.Control con in cc.Controls)
{
Response.Write(con.UniqueID.ToString());
if(con is System.Web.UI.WebControls.TextBox)
{
System.Web.UI.WebControls.TextBox tb=(System.Web.UI.WebControls.TextBox)con;
tb.Text="nihao";
}
}
}
}
}
注意:TextBox放到别的控件里面的