What is the use of Global.asax file?

 Posted by Nagasundar_Tn on 12/4/2012 | Category: ASP.NET Interview questions | Views: 4341 | Points: 40
Select from following answers:
  1. To declare global variables which can be accessed throught the application.
  2. To implment application level and session level events.
  3. To configure the values like SQLConnecton string or giving reference of dlls
  4. All Above

Show Correct Answer

Asked In: Ramco Systems | Alert Moderator 

Comments or Responses

Posted by: Gaurav1usmore on: 1/22/2013 | Points: 10
The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level events raised by ASP.NET or by HttpModules.

The Global.asax file resides in the root directory of an ASP.NET-based application. The Global.asax file is parsed and dynamically compiled by ASP.NET.
The Global.asax file itself is configured so that any direct URL request for it is automatically rejected; external users cannot download or view the code written within it.

The Global.asax file does not need recompilation if no changes have been made to it. There can be only one Global.asax file per application and it should be located in the application's root directory only.
The Global.asax contains two types of events those are

Login to post response