Hi friends,
Ques : I want to know that what is a global.asax in ASP.NET.Please explain in brief?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted Mar 28, 2012, 10:32 AM
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
karthik vPosted Mar 28, 2012, 8:43 AM
Please refer to the link below which would give you very good understanding
Click Here