[Mono-devel-list] ASP.NET Page Life Cycle || Bug ?

Rob.Tillie at Student.tUL.EDU Rob.Tillie at Student.tUL.EDU
Sun Aug 22 01:54:05 EDT 2004


Hey,

You can call EnsureChildControls() before the code that needs it, that
should do the trick.

Greetz,
-- Rob.

> -----Original Message-----
> From: Alex Li [mailto:likwoka at gmail.com]
> Sent: Saturday, August 21, 2004 11:25 PM
> To: mono-devel-list at lists.ximian.com
> Subject: Re:[Mono-devel-list] ASP.NET Page Life Cycle || Bug ?
> 
> From the .NET Framework Developer's Guide, the last paragraph of the
> section "Control Execution Lifecycle":
> 
> " ... 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.
> 
> HTH,
> Alex
> 
> > 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
> > CreateChildControls().
> >
> > 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.
> >
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list