Adds

Thursday, 6 June 2013

Clear All Text Box Using Loop without Using TextBox Name.

public void ClearAllTextBox(ControlCollection ctrls)
  {
            foreach (Control ctrl in ctrls)
            {
                if (ctrl is TextBox)
                    ((TextBox)ctrl).Text = string.Empty;
                ClearAllTextBox(ctrl.Controls);
            }
  }

Use the code below in click event

ClearAllTextBox(Page.Controls);