asp.net页面详细执行流程

asp.net页面从请求到呈现给用户的过程

1. BeginRequest
2. AuthenticateRequest
3. PostAuthenticateRequest
4. AuthorizeRequest
5. PostAuthorizeRequest
6. ResolveRequestCache
7. PostResolveRequestCache
8. PostMapRequestHandler
9. AcquireRequestState
10. PostAcquireRequestState
11. PreRequestHandlerExecute
12. At this stage, the selected handler executes the current request. The most familiar handler is the Page handler.
13. PostRequestHandlerExecute
14. ReleaseRequestState
15. PostReleaseRequestState
16. UpdateRequestCache
17. PostUpdateRequestCache
18. EndRequest

其中第12步,具体的页面执行流程,分为如下步骤:

Page.OnPreInit
MasterPageControl.OnInit (for each control on the master page)
Control.OnInit (for each contol on the page)
MasterPage.OnInit
Page.OnInit
Page.OnInitComplete
Page.OnPreLoad
Page.OnLoad
MasterPage.OnLoad
MasterPageControl.OnLoad (for each control on the master page)
Control.OnLoad (for each contol on the page)
Page.OnXXX (control event)
MasterPage.OnBubbleEvent
Page.OnBubbleEvent
Page.OnLoadComplete
Page.OnPreRender
MasterPage.OnPreRender
MasterPageControl.OnPreRender (for each control on the master page)
Control.OnPreRender (for each contol on the page)
Page.OnPreRenderComplete
MasterPageControl.SaveControlState (for each control on the master page)
Control.SaveControlState (for each contol on the page)
Page.SaveViewState
Page.SavePageStateToPersistenceMedium
Page.OnSaveStateComplete
MasterPageControl.OnUnload (for each control on the master page)
Control.OnUnload (for each contol on the page)
MasterPage.OnUnload
Page.OnUnload

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]


Verify Code   If you cannot see the CheckCode image,please refresh the page again!