CreateChildControls... when and why?

D

DesignerX

I have several custom controls (which inherit from WebControl), I have
overriden the RenderContents of one of the custom controls. Within the
RenderContents function of this control (Control #1) I instantiate a
different custom control (Control #2) and call it's RenderControl function.
The CreateChildContents of Control #2 is never executed. I think this is
because Control #2 is not added to the control collection of Control #1.

When does CreateChildControls get called? When is it appropriate to use?
Most of my customer controls override load and render... what webcontrol
design benefits from CreateChildControls and how can I control when
CreateChildControls is fired?

Thanks for any help.
Stan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top