/// <summary>
/// 清空控件,清空指定的TextBox和Lale
/// </summary>
private void ClearControl()
{
//查找Form1中所有的控件
foreach(Control ct in this.FindControl("Form1").Controls)
{
if (ct is TextBox)
{
TextBox tb=(TextBox)ct;
//如果TextBox的名称不是TextBox1,则清楚控件的值
if(tb.ClientID !="TextBox1")
tb.Text = "";
}
if(ct is Label)
{
Label lb = (Label)ct;
lb.Text = "";
}
}