ASP.NET 2.0中几个对象的主要方法/事件流程

根据Lutz Roeder的Reflector对System.Web.dll的反编译,下面是HttpApplication,Page和Control对象的主要方法和事件的流程

     PostBack
     Page/Control Event
     CallBack
HttpApplication Page Control
BeginRequest    
AuthenticateRequest    
DefaultAuthentication    
PostAuthenticateRequest    
AuthorizeRequest    
PostAuthorizeRequest    
ResolveRequestCache    
PostResolveRequestCache    
MapHttpHandler Construct  
PostMapRequestHandler    
AcquireRequestState (Session)    
PostAcquireRequestState    
PreRequestHandlerExecute    
CallHandler

DeterminePostBackMode

 
LoadScrollPosition  
PerformPreInit
PreInit
–InitializeThemes
–ApplyMasterPage
 
InitRecursive
(–ResolveAdapter
–ApplySkin
Init
–TrackViewState)
ResolveAdapter
InitRecursive
ApplySkin
Init
TrackViewState
InitComplete

 
LoadAllState
–LoadPageStateFromPersistenceMedium
–LoadViewStateRecursive

LoadControlStateInternal
–LoadControlState

LoadViewStateRecursive
–LoadViewState
ProcessPostData  
PreLoad  
LoadRecursive
(–Load)
LoadRecursive
Load
ProcessPostData  
RaiseChangedEvents  
RaisePostBackEvent  
LoadComplete  
RaiseCallbackEvent
–return

 
PreRenderRecursiveInternal
(–PreRender)

PreRenderRecursiveInternal
PreRender
ExecuteRegisteredAsyncTasks **  
PerformPreRenderComplete
PreRenderComplete
 
SaveAllState
–SaveViewStateRecursive
–SavePageStateToPersistenceMedium
SaveControlStateInternal
–SaveControlState
SaveViewState
–SaveViewStateRecursive
SaveStateComplete  
RenderControl

RenderControl
–RenderControlInternal
—-Render
——RenderChildren
——–RenderChildrenInternal
PostRequestHandlerExecute    
ReleaseRequestState (Session)    
PostReleaseRequestState    
CallFilter — Response.FilterOutput    
UpdateRequestCache    
PostUpdateRequestCache    
EndRequest    

** 参考 Jeff Prosise在MSND杂志10月期的文章
Asynchronous Pages in ASP.NET 2.0

打赏作者