asp.net--Global Program Files: Global.asax

Source: Internet
Author: User

Asp. NET application can have only one Global.asax file, which supports many items.

Application_Start: Called when the application receives the first request, which is the ideal place to assign values to application-level variables in the application or to specify the state that must be persisted for all users.

Session_Start: Similar to the Application_Start event, but this event is called when the user accesses the application for the first time. For example, the Application_Start event is only triggered when the first request is received, the first request is run by the application, and the Session_Start event is invoked the first time each end user makes a request to the application.

Application_BeginRequest: It is not listed in the template provided by Visual Studio, but the event is triggered before each request is issued. That is, before the request arrives at the server and is processed, the Application_BeginRequest event is triggered and processed before the request is processed.

application_authenticaterequest: Each request triggers the event, allowing custom authentication to be established for the request.

Application_Error: Triggered when an error is thrown by the user of the application. It is appropriate to provide application-level error handling or to log errors to the server's event log.

Session_End: When running in InProc mode, this event is triggered when the end user exits the application.

Application_End: Triggered at the end of the application. Most ASP. NET developers do not use this event because ASP. NET completes the task of shutting down and cleaning up the remaining objects well.

asp.net--Global Program Files: Global.asax

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.