Fri Feb 8 08:55:55 EST 2008
" ... The CreateChildControls method is not listed in the table
because it is called whenever the ASP.NET page framework needs to
create the controls tree and this method call is not limited to a
specific phase in a control's lifecycle. For example,
CreateChildControls can be invoked when loading a page, during data
binding, or during rendering."
So this is not a bug. You just have to restructure your code call sequence.
> The end of this email has the basic life cycle as printed out via
> Response.Write methods within a page, and a control. I cannot seem to
> figure out why on a Control level Postback the CreateChildControls()
> method is called 3rd (which defines the HTML we'll see), while on any
> other Postback its after the Page.PreRender(). This would keep any
> Control Events from managing the data that needs to be printed
> How has anyone else dealt with this? This sure seems like a bug to me,
> any opinions? Its very possible I'm just missing something, but this
> seems counter-intuitive from every article on Page Life Cycle that I've
> read. I have tested this on Windows/.NET and Linux/Mono and I get the
> same results. My silly little test case is attached.
> Simply put, I really need a control event to change an array list that
> contains controls that get added during CreateChildControls(), but this
> seems impossible with the current design.
More information about the Mono-devel-list