A ‘WebPart’ control goes through various events and has a typical life cycle.
OnInit: - This is the initialization event and is the first event to occur.
OnLoad: - The load event.
CreateChildControls: - When any child controls are added to a composite control this event fires.
EnsureChildControls: - This event makes sure that ‘CreateChildControls’ fires.
OnPreRender: - This fires just before the render event.
Page.PreRenderComplete :- When all controls have executed the ‘OnPreRender’ event this event fires.
Render: - Render the full control.
RenderContents: - Renders the contents of the control only.
Asked In: Many Interviews |