What does EnsureChildControls really Ensure?

  • Thread starter Thread starter Sally
  • Start date Start date
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?
 
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.
 
Back
Top