What does EnsureChildControls really Ensure?

S

Sally

EnsureChildControls makes sure CreateChildControls() is called

So then the children are "created"

What does "created" actually mean? Is only Constructor() call?
OnInit()? OnLoad()? ...?

Guessing EnsureChildControls() is recursive. Are the grandchildren
"created" to?
 
J

John Saunders

Created means at least created and added to the parent's Controls
collection.

EnsureChildControls isn't recursive at all. Its little more than this:

if (!ChildControlsCreated)
{
CreateChildControls();
ChildControlsCreated = true;
}

Whether or when grandchild controls are created depends on the child
controls. If the child happens to call EnsureChildControls, then the
children of that child will be created.
 

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,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top