Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
Application|asp.net in asp.net application usage is the same as the ASP, almost nothing to say, but it has two more particularly useful events, Application_ OnBeginRequest and Application_onendrequest. Their same as the original Application_OnStart and Application_OnEnd are placed in the global file (note that this file in the ASP name is Global.asa, in ASP.net is global.asax).
Note: This event, write not write on is the same. Like Application_End and Application_OnEnd are the same
Application_OnStart is the first event that is triggered in the entire ASP.net application, which is triggered when the first ASP.net program executes in a virtual directory, and Application_OnEnd is just the opposite. is triggered when the entire application is stopped (usually when the server is restarted/shutdown). Application_onrequeststart and application_onrequestend occur when every ASP.net program is requested, which means that the client accesses one ASP.net program at a time, and the two events are triggered. We can see his application from the following procedure. We first set up a global.asax, which reads as follows:
Then put it in the root directory of this virtual directory, and then we'll open a random aspx file
The statement we defined in Global.asax is starting ... and request is ending ... This is not the one we added to this file, and we will see its shadow in any asp.net file.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
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:
and provide relevant evidence. A staff member will contact you within 5 working days.