This sample code should do what you're looking for:
Sub ClearTextBoxes()
Dim myForm As Control = Page.FindControl("form1")
Dim ctl As Control
For Each ctl In myForm.Controls
If ctl.GetType().ToString().Equals("System.Web.UI.WebControls.TextBox")
Then
CType(ctl, TextBox).Text = ""
End If
Next ctl
End Sub
You can use the HTML reset button. It works on the Web
controls also.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.