后台一次性清空多个textbox

foreach (System.Web.UI.Control control in Controls)
{
   for (int i = 0; i < control.Controls.Count; i++)
   {
       if (control.Controls[i] is System.Web.UI.WebControls.TextBox)
       {
          System.Web.UI.WebControls.TextBox tb = (System.Web.UI.WebControls.TextBox)control.Controls[i];
          tb.Text = "";
       }
   }
}
posted @ 2012-04-24 17:27  ~夜~  阅读(212)  评论(0编辑  收藏  举报