Web Page Life Cycle

Here I am not going to explain web request process but will just give you the sequence of occurance of a web page events.

Below is the sequence of web page events:

Page Initialization
Load ViewState
Load Post Data
Page Load
Raised Postback Changed Event
Raised Postback
Page PreRender
Save ViewState
Page Render
Page Unload

Now, lets take a scenario, there is a web page built upon a master page and contains a web usercontrol that has child web usercontrol in it.

Here is the sequence of events post execution of HttpModules:


Page- PreInit

Init - ChildUserControl
Init - UserControl
Init - MasterPage
Init - Page

Page- InitComplete

Page- PreLoad

Load- Page
Load- MasterPage
Load- UserControl
Load- ChildUserControl

PostBack Event

DataBinding- Page
DataBinding- MasterPage
DataBinding- UserControl
DataBinding- ChildUserControl

Page- LoadComplete

PreRender- Page
PreRender- MasterPage
PreRender- UserControl
PreRender- ChildUserControl

Page- PreRenderComplete

Page- SaveViewStateComplete

Unload- ChildUserControl
Unload- - UserControl
Unload- - MasterPage
Unload- - Page

No comments: