Page Life Cycle In ASP.NET 2.0
|
Stage
|
Event
|
What To Do
|
What Done
|
|
Initialization
|
Page PreInit
|
- change themes, master pages
- access properties for a profile
|
master pages, themes, etc. are applied
|
|
|
Control Init
Page Init
|
- read or initialize properties of controls in the control hierarchy.
- add dynamic controls that need to utilize view state
|
Controls are initialized with declarative properties.
|
|
|
Page InitComplete
|
- access controls on the page
|
Begin to track view state changes
|
|
Page Load
|
Page PreLoad
|
|
View state data saved from the previous page are populated to the controls
Postback data are restored
|
|
|
Page Load
Control Load
|
|
|
|
Raise Postback Event
|
|
|
Control events are handled
|
|
|
Page LoadComplete
|
|
|
|
PreRender
|
Page PreRender
|
|
|
|
|
Page PreRenderComplete
|
|
All controls have been added to the page and the page is ready to be rendered
|
|
Save View State
|
|
|
View state and control state have been saved
|
|
|
Page SaveStateComplete
|
|
|
|
Render
|
|
|
HtmlTextWriter is initialized and the page is rendered to the browser
|
|
Unload
|
Control Unload
Page Unload
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|