Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Looping through all the controls
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01375750
Message ID:
01375923
Vues:
6
>>>I am using a Custom Control (based on a Panel) to contain all sorts of controls, which in turn contain all sorts of controls, which may contain all sorts of controls.
>>>
>>>I need to iterate through all the controls so that I can set the BindingSource at runtime. Does anyone know an easy way to get to all of the controls, a simple foreach at the top level won't cut it.
>>
>>Here is an example:
>>
>>
>>        ' Loop through all the controls on the page and apply the business logic
>>        ' expO1 Control
>>        Public Function PageControlRecursiveLoop(ByVal toControl As Object) 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 loControlForm As System.Web.UI.HtmlControls.HtmlForm
>>            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
>
>
>Looked like a Localization kludge I did in 1.1
>
>What a nightmare to pick that up and attempt to display the proper language for forms before localization.

Can you please explain what do you mean here?
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform