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 asp.net. Also check Dataset and Datareader asp.net.

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:

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

2-Init-
Raised after all the controls have been initialized.

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

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

5-Load-

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.

7-PreRender-
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.

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

11-Unload-
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"