ASNA Monarch Control Execution Lifecycle

This document provides information regarding the Control Execution Lifecycle showing the phase, action and / or method or event that is triggered. See ASP.NET Page Object Model or Control Execution Lifecycle in the MSDN help for further detail about the ASP.NET phases.

The CreateChildControls method is not listed in the table because it is called whenever the ASP.NET page framework needs to create the controls tree and this method call is not limited to a specific phase in a control's life cycle. For example, CreateChildControls can be invoked when loading a page, during data binding, or during rendering.

Control Execution Lifecycle Table

Phase Action Method or Event to Override
Initialize Initialize settings needed during the lifetime of the incoming Web request. Init event / OnInit method
Load view state At the end of this phase, the ViewState property of a control is automatically populated. LoadViewState method
Process postback data Process incoming form data and update properties accordingly. LoadPostData method
Load Perform actions common to all requests, such as setting up a database query. At this point, server controls in the tree are created and initialized, the state is restored, and form controls reflect client-side data. Load event / OnLoad method
Send postback change notifications Raise change events in response to state changes between the current and previous postback. RaisePostDataChangedEvent method
Handle postback events Handle the client-side event that caused the postback and raise appropriate events on the server. RaisePostBackEvent method
Prerender Perform any necessary pre-rendering steps prior to saving view state and rendering content. PreRender event / OnPreRender method
NEW Monarch Phase:
Copy browser to display file
(Also see Page.OutOfSequence) If this request is a postback, the data sent by the browser is copied to the display buffer data set. Code-behind logic here can stop the next phase. OnCopyBrowserToDspFile method
NEW Monarch Phase: Process Business Rules Program waiting on an EXFMT continues to run until a new EXFMT is found (or read). AVR program
NEW Monarch Phase:
Copy display file to browser
Data is copied from the display buffer data set to the "dds" controls in the page. Perform any updates before the output is rendered. Any changes made to the state of controls can be saved, while changes made in the rendering phase are lost. OnCopyDspFileToBrowser method
Save state The ViewState property of a control is automatically persisted to a string object after this stage. SaveViewState method
Render Generate output to be rendered to the client. Render method
Unload Perform any final cleanup before the control is torn down. Control authors generally perform cleanup in Dispose and do not handle this event. UnLoad event / OnUnload method

Next: Monarch Job and Program Classes

Previous: Execution Context