Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Application or Sessions Variables

Status
Not open for further replies.

opo

Programmer
Jul 30, 2001
56
US
Trying to set some variables in my global.asa file.
Can someone give me a complete example of one.
 
The following is from the w3schools ASP site:
"visitors" would be the variable

global.asa
----------
<script language=&quot;vbscript&quot; runat=&quot;server&quot;>
Sub Application_OnStart
Application(&quot;visitors&quot;)=0
End Sub

Sub Session_OnStart
Application.Lock
Application(&quot;visitors&quot;)=Application(&quot;visitors&quot;)+1
Application.UnLock
End Sub

Sub Session_OnEnd
Application.Lock
Application(&quot;visitors&quot;)=Application(&quot;visitors&quot;)-1
Application.UnLock
End Sub

</script>

Now to reference that variable:

myPage.asp
----------
<html>
<head>
</head>
<body>
<p>
There are <%response.write(Application(&quot;visitors&quot;))%>
online now!
</p>
</body>
</html>





 
Tried it and got this message
The scripting language 'VBSript' is not found on the server.
//global.asa, line 3
Am i forgetting to setup something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top