Thanks Ben. After reading your post I did some further testing, including
creating a new bare parent/child control just to see if it was something
else in my two controls.

The results were surprising. My bare minimal controls behaved as what you
stated and as I had originally suspected, the events remained synchronized
with the page (tho sometimes the child control would fire its event before
the parent control - tho that could be due to the placement of the trace
statements).

Then I realised that my controls are kindof created dynamically. I say
kindof because they aren't created asmuch as shifted. Basically ages ago I
created a user control to create tables with rounded corners, with a title
bar across the top. To workout what content should go in the middle cell of
the table and what should go in the title bar I created two properties for
the class (body and title) which are of type control. When the Table
controls CreateChildControls is called I generate my table, and basically
iterate through the Title.Controls collection and add them to the top
middle cell and do something similar for the body control property and the
bottom middle cell.

So then what I did was place my bare minimal child control inside of my
table control inside of my bare minimal parent control and got the same
behaviour that I was getting with my regular contrls. The child controls
page_load event is not fired until just before the parents render method
call.

So now that I have found the cause, I am still in need of a solution. It
obviously has something to do with my rearrangement of the control
heirarchy. But I am unsure of a way to move the controls (or wrap them
inside a table) without effecting the event fire order.

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