| HttpApplication |
|
Based on the file name extension of the requested resource (mapped in the application's configuration file), select a class that implements IHttpHandler to process the request. If the request is for an object (page) derived from the Page class and the page needs to be compiled, ASP.NET compiles the page before creating an instance of it |
| HttpApplication |
|
Call the ProcessRequest method (or the asynchronous version IHttpAsyncHandler::BeginProcessRequest) of the appropriate IHttpHandler class for the request. For example, if the request is for a page, the current page instance handles the request |
| HttpApplication |
|
Perform response filtering if the Filter property is defined |
| HttpApplication |
Start |
Called when the first resource (such as a page) in an ASP.NET application is requested. The Application_Start method is called only one time during the life cycle of an application. You can use this method to perform startup tasks such as loading data into the cache and initializing static values.
You should set only static data during application start. Do not set any instance data because it will be available only to the first instance of the HttpApplication class that is created
|
| HttpModule |
BeginRequest |
The BeginRequest event signals the creation of any given new request. This event is always raised and is always the first event to occur during the processing of a request |
| HttpModule |
AuthenticateRequest |
The AuthenticateRequest event signals that the configured authentication mechanism has authenticated the current request. Subscribing to the AuthenticateRequest event ensures that the request will be authenticated before processing the attached module or event handler |
| HttpModule |
PostAuthenticateRequest |
The PostAuthenticateRequest event is raised after the AuthenticateRequest event has occurred. Functionality that subscribes to the PostAuthenticateRequest event can access any data that is processed by the PostAuthenticateRequest |
| HttpModule |
AuthorizeRequest |
The AuthorizeRequest event signals that ASP.NET has authorized the current request. Subscribing to the AuthorizeRequest event ensures that the request will be authenticated and authorized before processing the attached module or event handler |
| HttpModule |
ResolveRequestCache |
Occurs when ASP.NET finishes an authorization event to let the caching modules serve requests from the cache, bypassing execution of the event handler (for example, a page or an XML Web service). |
| HttpModule |
PostResolveRequestCache |
Occurs when ASP.NET bypasses execution of the current event handler and allows a caching module to serve a request from the cache |
| HttpModule |
PostMapRequestHandler |
Occurs when ASP.NET has mapped the current request to the appropriate event handler |
| Session |
Start |
|
| HttpModule |
AcquireRequestState |
Occurs when ASP.NET acquires the current state (for example, session state) that is associated with the current request |
| HttpModule |
PostAcquireRequestState |
Occurs when the request state (for example, session state) that is associated with the current request has been obtained |
| HttpModule |
PreRequestHandlerExecute |
Occurs just before ASP.NET starts executing an event handler (for example, a page or an XML Web service) |
| Page |
PreInit |
Use this event for the following:
-
Check the IsPostBack property to determine whether this is the first time the page is being processed
-
Create or re-create dynamic controls
-
Set a master page dynamically
-
Set the Theme property dynamically
-
Read or set profile property values
Note
If the request is a postback, the values of the controls have not yet been restored from view state. If you set a control property at this stage, its value might be overwritten in the next event.
|
| WebUserControl |
Init |
Initialize settings needed during the lifetime of the incoming Web request. See Handling Inherited Events |
| Page |
Init |
Raised after all controls have been initialized and any skin settings have been applied. Use this event to read or initialize control properties |
| Page |
InitComplete |
Use this event for processing tasks that require all initialization be complete |
| Page |
PreLoad |
Use this event if you need to perform processing on your page or control before the Load event.
After the Page raises this event, it loads view state for itself and all controls, and then processes any postback data included with the Request instance
|
| WebUserControl |
LoadViewState |
At the end of this phase, the ViewState property of a control is automatically populated as described in Maintaining State in a Control. A control can override the default implementation of the LoadViewState method to customize state restoration |
| WebUserControl |
LoadPostData |
Process incoming form data and update properties accordingly. See Processing Postback Data.
Note
Only controls that process postback data participate in this phase
|
| Page |
Load |
The Page calls the OnLoad event method on the Page, then recursively does the same for each child control, which does the same for each of its child controls until the page and all controls are loaded.
Use the OnLoad event method to set properties in controls and establish database connections
|
| WebUserControl |
Load |
Perform actions common to all requests, such as setting up a database query. At this point, server controls in the tree are created and initialized, the state is restored, and form controls reflect client-side data. See Handling Inherited Events |
| WebUserControl |
RaisePostDataChangedEvent
(if IPostBackDataHandler is implemented)
|
Raise change events in response to state changes between the current and previous postbacks. See Processing Postback Data.
Note Only controls that raise postback change events participate in this phase
|
| WebUserControl |
RaisePostBackEvent (if IPostBackEventHandler is implemented) |
Handle the client-side event that caused the postback and raise appropriate events on the server. See Capturing Postback Events.
Note Only controls that process postback events participate in this phase.
|
| Page |
CONTROL EVENTS |
Use these events to handle specific control events, such as a Button control's Click event or a TextBox control's TextChanged event.
Note
In a postback request, if the page contains validator controls, check the IsValid property of the Page and of individual validation controls before performing any processing.
|
| Page |
LoadComplete |
Use this event for tasks that require that all other controls on the page be loaded |
| Page |
PreRender |
Before this event occurs:
-
The Page object calls EnsureChildControls for each control and for the page.
-
Each data bound control whose DataSourceID property is set calls its DataBind method. For more information, see Data Binding Events for Data-Bound Controls below.
The PreRender event occurs for each control on the page. Use the event to make final changes to the contents of the page or its controls
|
| WebUserControl |
PreRender |
Perform any updates before the output is rendered. Any changes made to the state of the control in the prerender phase can be saved, while changes made in the rendering phase are lost. See Handling Inherited Events |
| Page |
PreRenderComplete |
Occurs before the page content is rendered. The PreRenderComplete event is raised when the pre-render stage of the page life cycle is complete. At this stage of the page life cycle, all controls are created, any pagination required is completed, and the page is ready to render to the output.
This is the last event raised before the page's view state is saved
|
| Page |
SaveViewState |
Saves any server control view-state changes that have occurred since the time the page was posted back to the server. |
| WebUserControl |
SaveViewState |
The ViewState property of a control is automatically persisted to a string object after this stage. This string object is sent to the client and back as a hidden variable. For improving efficiency, a control can override the SaveViewState method to modify the ViewState property. See Maintaining State in a Control |
| Page |
SaveStateComplete |
Before this event occurs, ViewState has been saved for the page and for all controls. Any changes to the page or controls at this point will be ignored.
Use this event perform tasks that require view state to be saved, but that do not make any changes to controls
|
| Page |
RenderControl |
Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.
If a server control's Visible property is set to true, this method determines whether tracing is enabled for the page. If so, it stores trace information associated with the control, and renders the server control content to the page.
This method is automatically called by the page during the rendering, but can be overridden by custom control developers.
|
| Page |
Render |
This is not an event; instead, at this stage of processing, the Page object calls this method on each control. All ASP.NET Web server controls have a Render method that writes out the control's markup that is sent to the browser.
If you create a custom control, you typically override this method to output the control's markup. However, if your custom control incorporates only standard ASP.NET Web server controls and no custom markup, you do not need to override the Render method. For more information, see Developing Custom ASP.NET Server Controls.
A user control (an .ascx file) automatically incorporates rendering, so you do not need to explicitly render the control in code
|
| Page |
RenderChildren |
Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client. This method notifies ASP.NET to render any Active Server Pages (ASP) code on the page. If no ASP code exists on the page, this method renders any child controls for the server control. |
| WebUserControl |
RenderControl |
Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled. |
| WebUserControl |
Render |
Generate output to be rendered to the client. See Rendering an ASP.NET Server Control |
| WebUserControl |
RenderChildren |
Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client. This method notifies ASP.NET to render any Active Server Pages (ASP) code on the page. If no ASP code exists on the page, this method renders any child controls for the server control. |
| WebUserControl |
Unload |
Perform any final cleanup before the control is torn down. Control authors generally perform cleanup in Dispose and do not handle this event |
| WebUsercontrol |
Dispose |
Perform any final cleanup before the control is torn down. References to expensive resources such as database connections must be released in this phase. See Methods in ASP.NET Server Controls |
| Page |
Unload |
This event occurs for each control and then for the page. In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.
For the page itself, use this event to do final cleanup work, such as closing open files and database connections, or finishing up logging or other request-specific tasks.
Note
During the unload stage, the page and its controls have been rendered, so you cannot make further changes to the response stream. If you attempt to call a method such as the Response.Write method, the page will throw an exception.
|
| Page |
Dispose |
Enables a server control to perform final clean up before it is released from memory. (inherited from Control) |
| HttpModule |
PostRequestHandlerExecute |
Occurs when the ASP.NET event handler (for example, a page or an XML Web service) finishes execution |
| HttpModule |
ReleaseRequestState |
Occurs after ASP.NET finishes executing all request event handlers. This event causes state modules to save the current state data. When the ReleaseRequestState event is raised, the application is finished with the request and ASP.NET is signaled to store the request state
|
| HttpModule |
PostReleaseRequestState |
Occurs when ASP.NET has completed executing all request event handlers and the request state data has been stored |
| HttpModule |
UpdateRequestCache |
Occurs when ASP.NET finishes executing an event handler in order to let caching modules store responses that will be used to serve subsequent requests from the cache |
| HttpModule |
PostUpdateRequestCache |
The PostUpdateRequestCache event is raised after the UpdateRequestCache event has occurred. When the PostUpdateRequestCache is raised, ASP.NET has completed processing code and the content of the cache is finalized. Occurs when ASP.NET finishes updating caching modules and storing responses that are used to serve subsequent requests from the cache.
|
| HttpModule |
EndRequest |
Occurs as the last event in the HTTP pipeline chain of execution when ASP.NET responds to a request. The EndRequest event is always raised when the CompleteRequest method is called.
|
| HttpModule |
PreSendRequestHeaders |
Occurs just before ASP.NET sends HTTP headers to the client |
| HttpModule |
PreSendRequestContent |
Occurs just before ASP.NET sends content to the client; The PreSendRequestContent event may occur multiple times |
| Session |
End |
|
| HttpModule |
Disposed |
Adds an event handler to listen to the Disposed event on the application. When you create a Disposed delegate, you identify the method that handles the event. To associate the event with your event handler, add an instance of the Disposed delegate to the event. The event handler is called whenever the event occurs, unless you remove the Disposed delegate. |
| Application |
End |
Called once per lifetime of the application before the application is unloaded |
| WebUserControl |
Finalize |
|
| Page |
Finalize |
|
| HttpModule |
Finalize |
|