clear all textboxes in a form
-
How to clear all textboxes in a form
-
How to clear all textboxes in a form
public void clearalltext(Form f) { foreach (Control c in f.Controls) { if (c.GetType().ToString() =="System.Windows.Forms.TextBox") c.Text = ""; } }
-
public void clearalltext(Form f) { foreach (Control c in f.Controls) { if (c.GetType().ToString() =="System.Windows.Forms.TextBox") c.Text = ""; } }
foreach (Control cntr in this.Page.Controls) { if (cntr is TextBox) { ((TextBox)cntr).Text = ""; } } Regard Imrankhan
please don't forget to vote on the post that helped you.
-
How to clear all textboxes in a form
Place a Reset button on the form using <Input type="Reset" /> Or you can also do : javascript:document.form1.reset(); to clear all data at a time without postback... ;) Form1 indicates the name of the form created. :thumbsup:
Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Microsoft Bing MAP using Javascript
CLR objects in SQL Server 2005
Uncommon C# Keywords/xml>