Link to home
Start Free TrialLog in
Avatar of adktd
adktdFlag for United States of America

asked on

Access user control property

Hi you experts.
I have a user control tha inside has 3 other user controls.For example lets say that the container control is called parent and the others uc1,uc2,uc3. Can you give me an example of how from uc3 i can retrieve the value of a property in uc1 ?

Thank you in advance.
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

There isn't any connection between user controls, other than through the parent container control, which has a reference to all the user controls.

Bob
Avatar of adktd

ASKER

Yes i know,but how can i gain acess to user controls by using the parent container control's reference?
That kind of work should be done in the container, and not at the user control level, since it has a reference to all the user controls.

Bob
You can have the user control fire an event, which the parent page will consume -- and at that point you will have access to all children controls.  I have a few demos that illustrate this.  Take note that you can use "sender" (an object) to pass-back to the parent any information from the child control that is relevant:

My demo page, with downloads:

http://www.geocities.com/managebrinkster/consume_events.html
ASKER CERTIFIED SOLUTION
Avatar of Tom Knowlton
Tom Knowlton
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you