ASP is pretty much Event-Oriented. So it’s important to know the exact Sequence of the Events for a Page-Life-Cycle.
Here’s the List (in sequence):
- Page.Init + Control.Init for every Control on the WebForm
The first Stage in the Page life cycle is Initialization. After the Page’s Control-Tree is populated with all the statically declared Controls in the .aspx Source the Init Event is fired. First, the Init Event for the Page Object occurs, then Init Event occurs for each Control on the Page. ViewState Information is not available at this Stage. - Page.LoadViewState
After Initialization, ASP.NET loads the ViewState for the Page. ViewState contains the State of the Controls the last time the Page was processed on the Server. - Page.ProcessPostData
Post Data gets read from the Request and Control Values are applied to Controls initalized in Stage 1. - Page.Load + Control.Load for each Control on the Page
If this is the first time the Page is being processed (Page.IsPostback Property), initial data binding is performed here. - “Change” events are fired for Controls (TextChanged, SelectedIndexChanged, and similar)
The current Value (from Post Data) is compared to the original Value located in the ViewState. If there is a difference “Changed” Events are raised. - Server-Side Events are fired for any Validation Controls
- Button.Click + Button.Command
The Click and Command Events are fired for the Button that caused the Postback - Page.PreRender + Control.PreRender
- Page.SaveViewState
New Values for all the Controls are saved to the ViewState for another round-trip to the Server. - Page.Render
There’s more Information in MSDN: The ASP.NET Page Object Model