Follow in Twitter & Facebook

Like in Facebook

Powered By Blogger Widgets

Free Download

FREE Tools

Tuesday, February 14, 2012

Page Lifecycle Events in ASP.Net

Here we will see what are the page life cycle events in Also check Dataset and Datareader

With in Each stage of the life cycle the page raises Events that you can handle to run your own code. These are as follows:

Raised before the Initialization stage begins Here the Ispostback property is checked to determine wheather the first time the page is being processed.

Raised after all the controls have been initialized.

3-Init complete:
Raised at the end of the page initialization stage.

Raised after the page loads view state for itself and all its controls.


Here the page calls the OnLoad method,Use this method to set the properties in controls and to establish the database connection.

6-Load Complete-
Raised at the end of the event handling stage.

The page object raises the prerender event to make the final changes to the contents of the
 the page or its controls before the rendering stage begins.

8-PreRender Complete-
Raised after each data bound control whose DataSourceID property is set calls its DataBind method.

9-Save State Complete-
Raised after viewstate and controlstate have been saved for the page and for all the controls.

 All the ASP.Net webserver controls have a Render method that writes out the controls markup to the browser.

Raised for each control and then for the page.This event is used to do the final cleanup work, like closing the open files and database connections.

0 on: "Page Lifecycle Events in ASP.Net"