Aditya 0
how to clear multiple textboxes with minimal coding on an asp.net web page ?
By Aditya 0 in ASP.NET on Aug 10 2006
  • Jeyaram Thangaponnan
    Aug, 2006 23

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

    • 0
  • farshad
    Aug, 2006 14

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

    • 0
  • Aug, 2006 10

    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

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS