ASP.NET: Event order

So much troubleshooting of ASP.NET is aided by understanding the order in which the events occur within the page life cycle. For example, notice how the Init and Load events are inverted for Pages the ChildUserControls.

Here you'll find all the phases that an ASP.NET-page goes through.

BeginRequest - HttpModule
AuthenticateRequest - HttpModule
PostAuthenticateRequest - HttpModule
PostAuthorizeRequest - HttpModule
ResolveRequestCache - HttpModule
PostResolveRequestCache - HttpModule
PostMapRequestHandler - HttpModule
AcquireRequestState - HttpModule
PostAcquireRequestState - HttpModule
PreRequestHandlerExecute - HttpModule

PreInit - Page

Init - ChildUserControl
Init - UserControl
Init - MasterPage
Init - Page

InitComplete - Page

LoadPageStateFromPersistenceMedium - Page

ProcessPostData (first try) - Page

PreLoad - Page

Load - Page
Load - MasterPage
Load - UserControl
Load - ChildUserControl

ProcessPostData (second try) - Page

RaiseChangedEvents - Page
RaisePostBackEvent - Page

Click - Button - ChildUserControl

DataBinding - Page
DataBinding - MasterPage
DataBinding - UserControl
DataBinding - ChildUserControl

LoadComplete - Page

PreRender - Page
PreRender - MasterPage
PreRender - UserControl
PreRender - ChildUserControl

PreRenderComplete - Page

SaveViewState - Page
SavePageStateToPersistenceMedium - Page
SaveStateComplete - Page

Unload - ChildUserControl
Unload - UserControl
Unload - MasterPage
Unload - Page

PostRequestHandlerExecute - HttpModule
ReleaseRequestState - HttpModule
PostReleaseRequestState - HttpModule
UpdateRequestCache - HttpModule
PostUpdateRequestCache - HttpModule
EndRequest - HttpModule
PreSendRequestHeaders - HttpModule
PreSendRequestContent - HttpModule

Related posts:

Comments

comments powered by Disqus