Hi friends,
Ques : I want to know that what is a global.asax in ASP.NET.Please explain in brief?
Define global.asax in ASP.NET.
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
karthik v115 reputationPosted Mar 28, 2012, 4:43 AM EDT
Please refer to the link below which would give you very good understanding
Click Here
SenthilkumarRank #387 · 6.5K reputationPosted Mar 28, 2012, 6:32 AM EDT
The global.aspx is global event file in ASP.Net and the application can have only one file in the root folder.
It is used to handle the application level events. It is an option file and if there are any events written then it will be fired. If you want to share any information across the users then application level logic has to be written in this file. Because session will be per use and the global data which has to be shared across the server needs to written in Application_Start event. It will be fired at the first request to the server.
If you want to write any logic while application shutdown then Application_End event should be fired.
Some times we may need to write the logic when new session starts. When user logged in then new session will be started and it will fire the Session_start and when session ends Session_End event will be fired. This will be shared only for that session.
If there is any error occur in the application then Application_Error event helps you to capture the error.
I suggest you to go through this link for more info:
http://msdn.microsoft.com/en-us/library/1xaas8a2(v=vs.71).aspx