Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to reference a control in user control?
Message
 
 
To
04/02/2010 10:27:59
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01447396
Message ID:
01447490
Views:
20
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform