The ensurechildcontrols () method determines whether a control set has been generated. If not, the createchildcontrols () method is called.
When a page is loaded into the view status (loadviewstaterecursive), you must call the loadviewstaterecursive (Object savedstate) method. Within the page, you must call the arraylist childstate. In loadchildviewstatebyid, findcontrol (string ID) the findcontrol (string ID) method first calls ensurechildcontrols () and determines whether the createchildcontrols () method has been called.
The ensurechildcontrols () method is called when the page is in the pre-rendering phase (prerenderrecursiveinternal.
Implementation of the rendercontrol, render, and renderchildren methods in the control class
Public void rendercontrol (htmltextwriter writer)
{
If (visilble)
Render (writer );
}
Protected virtual void render (htmltextwriter writer)
{
Renderchildren (writer );
}
Protected virtual void renderchildren (htmltextwriter writer)
{
Foreach (control C in controls)
C. rendercontrol (writer );
}