一个aspx页面里所有的控件
}
void Emptcontro(Control cc)//清空页面所有的textbox文本
{
if (cc == null)
{
for (int j = 0; j < this.Controls.Count; j++)
{
foreach (Control o in Page.Controls[j].Controls)
{
Emptcontro(o);
if (o is TextBox)
{
TextBox txt = (System.Web.UI.WebControls.TextBox)o;
txt.Text = string.Empty;
}
}
}
}
else {
if (cc is TextBox)
{
TextBox txt = (System.Web.UI.WebControls.TextBox)cc;
txt.Text = string.Empty;
}
else
{
foreach (Control o in cc.Controls)
{
Emptcontro(o);
}
}
}
}