protected void ClearControl(ControlCollection ct)
{
foreach (Control ctl in ct)
{
if (ctl is TextBox)
{
TextBox t = (TextBox)ctl;
t.Text = string.Empty;
}
if (ctl.HasControls())
{
ClearControl(ctl.Controls);
}
}
}
/// <summary>
/// 隐藏textbox
/// </summary>
/// <param name="ct"></param>
protected void VisibleControl(ControlCollection ct)
{
foreach (Control ctl in ct)
{
if (ctl is TextBox)
{
TextBox t = (TextBox)ctl;
t.Visible = false;
}
if (ctl.HasControls())
{
VisibleControl(ctl.Controls);
}
}
}
ClearControl(this.Controls);