Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to reference a control in user control?
Message
 
 
À
04/02/2010 10:27:59
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01447396
Message ID:
01447490
Vues:
21
>Dmitry, I wouldn't expose the properties of your UserControl publicly unless you really needed to. If all you need to do is DataBind the controls that are in your UserControl, do it by adding a DataBind method to your UserControl and pass in the DataTable as a parameter.
>
>~~Bonnie

Thank you, Bonnie. If I were to add a method to UserControl, does it mean that I have to subclass this control and create it in code in a .CS file? Currently I create a UserControl by - in designer - adding a new UserControl. Then I drop some other controls on this user control form (like textbox, button). I can't think of how in this scenario I would add a method to the UserControl. Am I missing something simple?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform