|
The
ASP.NET Global.asax file can co-exist with the ASP Global.asa file.
You can create a Global.asax file. This can be done 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 re-parses and recompiles the Global.asax
file and raises the Application_OnStart event.
The
Global.asa file is also an optional file in which you can specify
event scripts and declare objects that have session or application
scope. It is not a content file displayed to the users. Instead
it stores event information and objects used globally by the application.
This file must be named Global.asa and must be stored in the root
directory of the application. An application can only have one Global.asa
file.
|