Stage
|
Actions that the control needs to perform
|
The method or event to override
|
Class
|
Initializes the settings that are required within the life cycle of the incoming WEB request.
|
Init Event (OnInit method)
|
Load View state
|
At the end of this phase, the control's ViewState property is automatically populated, and the control can override the default implementation of the LoadViewState method to customize the state restore.
|
LoadViewState method
|
Processing postback data
|
Process incoming form data and update the properties accordingly. Note: Only controls that process postback data are involved in this phase.
|
LoadPostData method (if IPostBackDataHandler is implemented)
|
Load
|
Perform actions that are common to all requests, such as setting up a database query. At this point, the server control in the tree has been created and initialized, the state has been restored, and the form control reflects the client's data.
|
Load Event (OnLoad method)
|
Send a postback change notification
|
Raises a change event to respond to a state change between the current and the previous postback. Note: Only controls that raise postback change events are involved in this phase.
|
RaisePostDataChangedEvent method (if IPostBackDataHandler is implemented)
|
Handling Postback Events
|
Handles the client event that caused the postback and raises the appropriate event on the server. Note: Only controls that handle postback events participate in this phase.
|
RaisePostBackEvent method (if IPostBackEventHandler is implemented)
|
Pre-rendering
|
Performs any updates before rendering the output. You can save changes to the state of the control at the present stage, and changes that are made to the rendering phase are lost.
|
PreRender Event (OnPreRender method)
|
Save state
|
After this phase, the control's ViewState property is automatically persisted to the string object. This string object is sent to the client and sent back as a hidden variable. To improve efficiency, controls can override the SaveViewState method to modify the ViewState property.
|
SaveViewState method
|
Present
|
Generates output that is rendered to the client.
|
Render method
|
Disposal
|
Performs all final cleanup operations before destroying the control. References to expensive resources, such as database links, must be released at this stage.
|
Dispose method
|
Unloading
|
Performs all final cleanup operations before destroying the control. Control authors typically perform cleanup in Dispose without handling this event.
|
UnLoad event (on UnLoad method)
|