Sunday, August 12, 2007

Page Life Cycle

PAGE LIFE CYCLE WITH EVENTS

START
• HTTPRuntime
• Global.asax is parsed and compiled.

PRE INIT
• Check for IsPostback.
• Create or recreate dynamic controls.
• Set the Master page dynamically.
• Set the StyleSheetTheme property.
• Set the Culture property.
• Read or set the Profile property values.

PAGE INITIALIZATION
• Page_Init
• Read or change Control properties.
• Setup handlers for events.
• Load external template files.
• Load Viewstate
• Load application persistent information to controls.
• Specify how ViewState is stored.
• Specify how ViewState is mapped to the internal state.

PAGE LOAD
Page_Load
If this is the page’s first time being processed, then perform initial databinding.
Read and update control properties.

VALIDATION
• Validate()
• Validate information assigned to validation controls

EVENT HANDLING
• Page_DataBinding() : Bind data sources to controls.
• Page_PreRender
• Make final modifications to the page
• Change the control tree structure.
• SaveViewState()

RENDERING
• Page_Render
• Make changes to the HTML of a page.
• Write text for controls on a page.

UNLOAD
• Page_Dispose
• Discard objects used in the page, including the Page object.
• Page_Unload
• Close open files.
• Close open database connections.
• Finish logging or other request-specific tasks.

No comments: