Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Loop through controls
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01331607
Message ID:
01331612
Views:
7
>Hi All,
>
>I am trying to loop through all the controls on my ASP.NET page. Instead the following code returns all the controls on the Master Page. How do I reference the actual ASP.NET forms and not the Master Page?
>
>
>For Each myControl As Control In Page.Form.Controls
>            If TypeOf myControl Is TextBox Then
>                If InStr(myControl.ID, "unboxlength") Then
>                    CType(myControl, TextBox).Text = "This one"
>                End If
>
>            End If
>        Next myControl
>
>
>Thank you,
>Daniel

Where did you place this code? Also do you need Page.Form or it can be just Page.Controls?
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform