ASP.NET MVC Global.asaxファイル内のイベント

15423 ワード

  1 public class MvcApplication : System.Web.HttpApplication
  2     {
  3         protected void Application_Start(object sender, EventArgs e)
  4         {
  5             //         
  6             // Web               
  7             //                      
  8             //                
  9         }
 10 
 11         void Application_End(object sender, EventArgs e)
 12         {
 13             //         
 14             //             ,     HttpApplication      
 15             //  IIS  ,    ,                     
 16         }
 17 
 18         void Session_Start(object sender, EventArgs e)
 19         {
 20             //         
 21             //       
 22         }
 23 
 24         void Session_End(object sender, EventArgs e)
 25         {
 26             //         
 27             //          
 28             //           Session  Session      ,        
 29         }
 30 
 31         void Application_Init(object sender, EventArgs e)
 32         {
 33             //         
 34             //    HttpApplication          
 35         }
 36 
 37         void Application_Disposed(object sender, EventArgs e)
 38         {
 39             //         
 40             //              , .net                     。
 41             //    HttpApplication         
 42         }
 43 
 44         void Application_Error(object sender, EventArgs e)
 45         {
 46             //         
 47             //                    
 48         }
 49 
 50 
 51         /*********************************************************************/
 52         //                
 53         /*********************************************************************/
 54 
 55         void Application_BeginRequest(object sender, EventArgs e)
 56         {
 57             //
 58         }
 59 
 60         void Application_AuthenticateRequest(object sender, EventArgs e)
 61         {
 62             //
 63         }
 64 
 65         void Application_AuthorizeRequest(object sender, EventArgs e)
 66         {
 67             //                    
 68         }
 69 
 70         void Application_ResolveRequestCache(object sender, EventArgs e)
 71         {
 72             // ASP.NET                          ,        (     WebService)   。
 73             //            ,                 Cache    。
 74         }
 75 
 76         //------------------------------------------------------------------------
 77         //     ,           。  :web            
 78         //------------------------------------------------------------------------
 79 
 80         void Application_AcquireRequestState(object sender, EventArgs e)
 81         {
 82             //   Session                  Session    
 83         }
 84 
 85         void Application_PreRequestHandlerExecute(object sender, EventArgs e)
 86         {
 87             //               
 88             //    ,Session     
 89         }
 90 
 91         //-------------------------------------------------
 92         //     ,         ,     HTML
 93         //-------------------------------------------------
 94 
 95         void Application_PostRequestHandlerExecute(object sender, EventArgs e)
 96         {
 97             //
 98         }
 99 
100         void Application_ReleaseRequestState(object sender, EventArgs e)
101         {
102             //      
103         }
104 
105         void Application_UpdateRequestCache(object sender, EventArgs e)
106         {
107             //
108         }
109 
110         void Application_EndRequest(object sender, EventArgs e)
111         {
112             //EndRequest    Request          
113             //
114         }
115 
116         void Application_PreSendRequestHeaders(object sender, EventArgs e)
117         {
118             //      Http       
119         }
120 
121         void Application_PreSendRequestContent(object sender, EventArgs e)
122         {
123             //      Http       
124         }
125     }

 
転載先:https://www.cnblogs.com/xiabuyanyu/p/7807757.html