Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
ASP.NET
« Previous
Next »
Why is Global.asax used?
Options
- Declare Global variables
- Implement application and session level events
- No use
CORRECT ANSWER : Implement application and session level events
Discussion Board
answer
NET Framework 1.1 110 out of 168 rated this helpful - Rate this topic
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. At run time, Global.asax is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplication base class. 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 ASP.NET Global.asax file can coexist with the ASP Global.asax file. You can create a Global.asax file either in a WYSIWYG designer, in Notepad, or as a compiled class that you deploy in your application's \Bin directory as an assembly. However, in the latter case, you still need a Global.asax file that refers to the assembly.
The Global.asax file is optional. If you do not define the file, the ASP.NET page framework assumes that you have not defined any application or session event handlers.
When you save changes to an active Global.asax file, the ASP.NET page framework detects that the file has been changed. It completes all current requests for the application, sends the Application_OnEnd event to any listeners, and restarts the application domain. In effect, this reboots the application, closing all browser sessions and flushing all state information. When the next incoming request from a browser arrives, the ASP.NET page framework reparses and recompiles the Global.asax file and raises the Application_OnStart event.
For detailed information about using the Global.asax file with your applications, see the following topics:
Working with HttpApplication Instances
Using Modules with the Global.asax File
Thakkar Nishit 09-22-2014 10:34 AM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
ASP.NET (41)
ASP.NET (16)
ASP.NET (16)
ASP.NET for Freshers (19)
ASP.NET for Experienced (19)
ASP.NET (20)
ASP.NET (20)
ASP.NET (25)
ASP.NET (20)
ASP.NET (20)
ASP.NET (20)
ASP.NET (20)
Dot.Net (100)
.NET Framework (26)
.NET Caching (7)
.NET Remoting and webservices (10)
.NET Security (11)
ADO.NET (10)
C#.NET (25)
VB.NET (33)
DOT.NET (10)
C#.NET freshers (20)
C#.NET freshers (20)
C#.NET experienced (20)
C#.NET (25)
C#.NET (20)
Sharepoint (20)
Sharepoint 2007 (15)
WCF (50)
WPF (45)
Advertisement
▲