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!
tyson
Printable View
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!
tyson
This is what I use, I use it to through through panels, and have just modified my code to get textboxes.VB Code:
For 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
Hope this helps.
Woka