Code ? Looping through controls
Code:
Private Sub Reset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Reset.Click
Dim tb As System.Web.UI.WebControls.TextBox
For Each tb In Page.Controls
tb.Text = ""
Next
End Sub
Hi everybody I have a reset button on a form and I want to clear all the textboxes on the form when you hit reset obviously... I don't want to have to go
textbox1.text = ""
textbox2.text = ""
textbox3.text = ""
a zillion times but the code above keep giving me errors anybody have any ideas as to what I'm doing wrong here...
Thanks for your help in advance