Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get all the lables
Message
From
20/12/2006 23:04:45
 
 
To
20/12/2006 22:04:11
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01179415
Message ID:
01179428
Views:
11
>How could I get all the labels in the webform? I have tried the following but I couln't get any label, am I missing out something? Any advice would be appreciated, thanks.
>
>
>For Each lblControl As Control In Me.Form.Controls
>    If TypeOf lblControl Is Label Then
>       ' Do something
>    End If
>Next
>
Here is what I use:
        ' Loop through all the controls on the page and apply the business logic
        ' expO1 Control
        ' expC1 Alias
        Public Function PageControlRecursiveLoop(ByVal toControl As Object, ByVal tcAlias As String) As Boolean
            Dim lcKey As String = ""
            Dim lcID As String = ""
            Dim lcMessage As String = ""
            Dim loControl As System.Web.UI.Control
            Dim loControlButton As System.Web.UI.WebControls.Button
            Dim loControlImage As System.Web.UI.WebControls.Image
            Dim loControlImageMap As System.Web.UI.WebControls.ImageMap
            Dim loControlLabel As System.Web.UI.WebControls.Label

            ' Label values
            For Each loControl In toControl.Controls

                ' Label
                If TypeOf loControl Is System.Web.UI.WebControls.Label Then
                    loControlLabel = CType(loControl, System.Web.UI.WebControls.Label)
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform