ASP.NET2.0页面执行顺序

0. Page_PreInit //如果有MasterPage的话,在这里执行MasterPage里面的page事件
1. Page_Init
2. Page_InitComplete
3. Page_PreLoad
4. Page_Load
5. Page_LoadComplete
6. Page_PreRender
7. Page_PreRenderComplete
8. Page_SaveStateComplete
 
MasterPage.master
UserControl_OnTop.ascx
Page.aspx
UserControl_InPage.ascx
UserControl_OnButtom.ascx

MasterPage UserControlOnTop Page UserControlInPage UserControlOnButtom
  Init      
      Init  
        Init
Init        
    Init    
    Load    
Load        
  Load      
      Lod  
        Load
ControlEvents ControlEvents ControlEvents ControlEvents ControlEvents
    PreRender    
PreRender        
  PreRender      
      PreRender  
        PreRender
  UnLoad      
      UnLoad  
        UnLoad
UnLoad        
    UnLoad    

你可能感兴趣的:(asp.net)