3
Reply

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

Aditya 0

Aditya 0

Aug 10, 2006
6k
0

    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 = "";

    Jeyaram Thangaponnan
    August 23, 2006
    0

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

    farshad
    August 14, 2006
    0

    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

    August 10, 2006
    0