3
Reply

how to clear multiple textboxes with minimal coding on an asp.net web page ?

Aditya 0

Aditya 0

18y
6k
0
Reply

    Try with the following code.

    Control myForm = Page.FindControl("Form1");

    foreach (Control ctl in myForm.Controls)
       if(ctl.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox"))
              ((TextBox)ctl).Text = "";

    //loop through panel controls
    foreach (Control oCtl in oFrm.Controls)
      {
    //find your control and do with it as you like here
       .....
      }

    If you want minimum coding than you must write your code in javascript function, you can take idea from the following code. Call the following function where you are handling your uncheck event. function ClearAll() { for(i=0;i

    18y
    0