Web Part life cycle in SharePoint 2010

Like Asp.Net life cycle there is also Web Part life cycle.
This method handles initialization of the control.
This event handles the Load event. This is also used for initialize the control but is not intended for loading data or other processing functionality.
This is the most popular event in web part life cycle. This creates any child controls. So if you are adding any control to display then you have to write in this method.
This method ensures that CreateChildControls has executed. EnsureChildControls method must be called to prevent null reference exceptions.
View state of the web part saved.
This method handles or initiates tasks such as data loading that must complete before the control can render.
The page fires the PreRenderComplete event after all controls have completed their OnPreRender methods.
This method is used to render everything.
Renders the contents of the control only, inside of the outer tags and style properties.
Performs the final cleanup.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s