Hi!
I have a form with 6 textboxes. How can i loop trough all textboxes. I have named them txtEmail1, txtEamil2 ect,ect.
I have somewhere in my brain that i could use a for each textboxes, but i dont know.
Can someone please help me!
tysonFor Each PageControl As System.Web.UI.Control In Page.Controls
If TypeOf PageControl Is System.Web.UI.WebControls.TextBox Then
Dim CurrentTextBox As TextBox = CType(PageControl, TextBox)
'code here to do somethign with textbox
End If
Next PageControl
This is what I use, I use it to through through panels, and have just modified my code to get textboxes.
Hope this helps.
Woka
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment