欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

javascript asp教程第十课--global asa

程序员文章站 2023-11-16 21:53:46
global.asa: first of all, what is a global.asa? it's an optional script file that ho...

global.asa:

first of all, what is a global.asa? it's an optional script file that holds certain "global" information that you can access through the entire asp appliciation. the global.asa is a plain text file saved with the .asa extension.

you should only have one global.asa and it should go in your top level directory.

below is an 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 you 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 do with the global.asa. let's move on to lesson 11.