Page Life Cycle of ASP.Net - Depth details
- Check for the
IsPostBackproperty to determine whether this is the first time the page is being processed.
- Create or recreate dynamic controls.
- Set master page dynamically.
- Set the
- Read or set profile property values.
If Request is postback:
- The values of the controls have not yet been restored from view state.
- If you set control property at this stage, its value might be overwritten in the next event.
- In the
Initevent of the individual controls occurs first, later the
Initevent of the Page takes place.
- This event is used to initialize control properties.
- Tracking of the ViewState is turned on in this event.
- Any changes made to the ViewState in this event are persisted even after the next postback.
- This event processes the postback data that is included with the request.
- In this event the
Pageobject calls the
OnLoadmethod on the
Pageobject itself, later the
OnLoadmethod of the controls is called.
Loadevent of the individual controls occurs after the
Loadevent of the page.
- This event is used to handle specific control events such as a
Clickevent or a
In case of postback:
- If the page contains validator controls, the
Page.IsValidproperty and the validation of the controls takes place before the firing of individual control events.
- This event occurs after the event handling stage.
- This event is used for tasks such as loading all other controls on the page.
- In this event the
PreRenderevent of the page is called first and later for the child control.
- This method is used to make final changes to the controls on the page like assigning the
DataSourceIdand calling the
- This event is raised after each control's
PreRenderproperty is completed.
- This is raised after the control state and view state have been saved for the page and for all controls.
- The page object calls this method on each control which is present on the page.
- This method writes the control’s markup to send it to the browser.
- This event is raised for each control and then for the