Global.asa:
What is a Global.asa? It's a optional script file that holds certain "global" information which you can access through the entire ASP Appliciati On. The Global.asa is a plain text file saved with the. asa extension.
You are should only have one global.asa and it should go in your top level directory.
Below is a example Global.asa file. Don ' t try to understand the script just yet. We ' ll get to the specifics in the next two lessons.
<object runat=server scope=session id=myinfo progid= "MSWC. MyInfo ">
</OBJECT>
<script runat=" Server "language=" JavaScript ">
function Application_ OnStart ()
{
application ("somevariablename") = "Some value"
}
function Application_OnEnd ()
{
Application.Contents.RemoveAll ()
}
function Session_OnStart ()
{
session.timeout=15
}
function Session_OnEnd ()
{
//do Nothing
}
</SCRIPT>
<!--METADATA type= "typelib"
file= "C:\Program Files\Common Files\ System\ado\msado15.dll "
-->
List of Can do ' s:
There are four things can do with a global.asa.
1) Object Declarations
2) Application Events
3) Session Events
4) Library Reference.
I don ' t expect you understand any of that yet. Just Remember, there are only a few things we can does with the Global.asa. Let ' s move on to lesson 11.