Hello friends,

While we are doing some big entry screens after submitting we will erase all the content in textboxes.For that we will do erasing each and every textbox.

It will takes a lot of time . To Reduce the difficulty use the simple code below:

Control myForm = Page.FindControl(“Form1”);

foreach (Control ctl in myForm.Controls)

{

if (ctl.GetType().ToString().Equals(“System.Web.UI.WebControls.TextBox”))

(TextBox)ctl).Text = “”;

}

Advertisements