I'm not sure why you are getting the event sequence you are mentioning, but
this is the way the events should be ocurring assumming the child controls
are added to the parent by or during it's Init event (this is not a
comprehesive list of events):
ParentA_Init, ChildA_Init, ParentA_Load, ChildA_Load, ParentA_PreRender,
ChildA_PreRender.

If you are experiencing the events in the order you are describing, are you
adding the ChildA control to ParentA's Control collection in the PreRender
of ParentA?

On Sat, 10 Aug 2002 10:13:26 +1000, Andrew Davey <[EMAIL PROTECTED]> wrote:

>Hi,
>
>I have a custom user control (I'll call it ChildA) which contains a drop
>down list, and this custom control is nested within another custom user
>control (I'll call it ParentA).
>
>I want to set a default value for ChildA (ie select an item in ChildA's
>drop down list) from ParentA. I figured the best place to do that was in
>ParentA's OnPreRender. However much to my surprise I found that ChildA's
>Page_Load event hadn't been fired yet at this stage, hence ChildA's
>Databind() method hadn't been called, hence there are no items in the
>drop down list to select.
>
>I've made a workaround by calling ChildA.Databind() from ParentA but I
>was wondering is there a better way, since I had to create a flag within
>ChildA to ensure that Databind() wasn't called twice (once by ParentA if
>it want's to set a default value and once by ChildA's Page_Load event).
>
>Is there a better way? Should I not be doing this in the OnPreRender
>method?
>
>TIA
>
>Andy
>
>You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to