Life Cycle of a Page - ASP.NET
{outline|||Step <1> - }
Mnemonic
¶
The order of the following steps can be remembered as "R-SILVER-U".
R = Request
S = Start
I = page Init
L = page Load
V = Validation
E = Event handling
R = page Render
U = page Unload
Detailed Steps
¶
Page Request
¶
User requests a page
Server checks if page is cached. If so, the cached page is sent to the client.
Otherwise the page is parsed and compiled.
Start
¶
Request
and
Response
objects are initialized, as is the
Page.IsPostBack
property.
Page Initialization
¶
Controls are initialized.
Postback data has NOT been loaded.
Control properties have NOT been set from viewstate.
Load
¶
If a postback, control properties are loaded from viewstate.
Validation
¶
Each validator is called, setting the
IsValid
property of each and of the page.
Postback Event Handling
¶
Postback event handlers are called
Rendering
¶
Viewstate is saved
The
Page.Render
method is called
The page is sent to the client
Unload
¶
Response
and
Request
objects are unloaded.
Cleanup is performed.