|
|
|
|
|
| | |
|
Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds
(Advanced)
(Components)
(Database)
(General)
(Vbscript)

|
|
Subject: |
Global.asa file and ASP applications |
From: |
Keith Engelhardt |
Date: |
3/5/1999 11:27:09 AM |
IP: |
198.97.67.57 |
According to Microsoft's on-line literature, To make the Application and Session object work in ASP, you use a single file named global.asa for each 'application'. This file resides in the directory on the server that is the root of that application—i.e. where the files that make up the application are located. When the first user accesses a file in the application, the Application_onStart event is triggered. This is used to initialize any application-wide global variables. When the user begins a session for the first time, the Session_onStart event is triggered.
I have create a brief test application. the only page in the application is:
<HTML>
<head>
<title> Test Counter</title>
</head>
<BODY>
<H1>Welcome</H1>
You are visitor number <%=Session("counter")%>
out of <%=Application("Counter")%>.
</BODY>
</HTML>
The Global asa file is:
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnStart()
iCount = Application("counter")
iCount = iCount + 1
Application("counter") = iCount ' Global counter
Session("counter") = iCount ' User's copy of counter
End Sub
</SCRIPT>
Both reside in the application's virtual root directory.
When the page is accessed it does't work. I have tried several examples of simple apps an and none seem to execute anything in the global.asa
I don't now what I am doing wrong! In every example I have seen the concept seem pretty basic. Does something have to be enabled on the server for the global.asa to be active?
Can any off assistance? |
Follow Up - Re: Global.asa file and ASP applications - Chris Williams 3/6/1999 10:21:49 AM
|
|

|
|
|
|
|
|
|
|
|
|