View Single Post
 
Old May 22nd, 2005, 07:09 AM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Andy,

Doing this breaks the model of the user control. The user control should be an autonomous unit that is not expected to live on a particular webform (which is what you are asking by expecting a particular property to be on the control's parent).

What are you trying to achieve? If your goal is to get some value back up to the web form, then I'd suggest one of two options:

1. Provide a public property on the user control so the web form can access it. This is better because the webform knows what controls will be on it, versus the user control NOT knowing on what web form it will be used.

2. Provide a public event on the user control so you can "tell" the webform about something that happened. And example would be a "SomethingChanged" event. Then raise that event on the user control and handle that event on the web form.

-Peter