Page Life Cycle in 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.

Advertisements

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