7of9121098
asked on
Global.asp question
I have a global.asa file in Win2K IIS 5.0, which counts the number of active users etc. if I put it under the wwwroot and call a script/... asp page it works fine, which it should. There if I'm running the same global.asa file in Nt 4.0 IIS. 4.0 it doesnt work, any Ideas?
In the script asp file I'm calling the active users
variable like so: <%=Application("ActiveUser s")%>d
See below for the global.asp code:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application("ActiveUsers") = 0
End Sub
Sub Session_OnStart
Session.Timeout = 20
Session("Start") = Now
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.UnLock
End Sub
Sub Session_OnEnd
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.UnLock
End Sub
</SCRIPT>
In the script asp file I'm calling the active users
variable like so: <%=Application("ActiveUser
See below for the global.asp code:
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application("ActiveUsers")
End Sub
Sub Session_OnStart
Session.Timeout = 20
Session("Start") = Now
Application("ActiveUsers")
Application.UnLock
End Sub
Sub Session_OnEnd
Application("ActiveUsers")
Application.UnLock
End Sub
</SCRIPT>
And finally make sure you've created a separate application in IIS.
First create a seperate virtual directory and try once.
It seems to me that all he has to do is create an application out of the directory this is running in.
Besides, what do you mean "won't run in NT 4"?
Do you get an error or what?
Besides, what do you mean "won't run in NT 4"?
Do you get an error or what?
ASKER
properties click on Configuration->App Options -> Enable Session State (Checked) ARE CHECKED.
ASKER
bsimmions, no error but when I use the
<%=Application("ActiveUser s")%> doen't print out anything.
<%=Application("ActiveUser
What about creating a separate application in IIS?
ASKER
What do you mean by creating a separate application in IIS?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I totally agree. That should do it.
Sub Session_OnStart
Session.Timeout = 20
Session("Start") = Now
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.UnLock
response.write "ActiveUsers :"& Application("ActiveUsers")
response.end
End Sub
try this and tell me what you have received in the Application varaible. If it displays the correct data, then step by step gothrough along with the flow of your site. Then find out where is problem arise.
Session.Timeout = 20
Session("Start") = Now
Application("ActiveUsers")
Application.UnLock
response.write "ActiveUsers :"& Application("ActiveUsers")
response.end
End Sub
try this and tell me what you have received in the Application varaible. If it displays the correct data, then step by step gothrough along with the flow of your site. Then find out where is problem arise.
manihopever:
I can tell you what this will give you..
response.write "ActiveUsers :"& Application("ActiveUsers")
nasty errors...
I can tell you what this will give you..
response.write "ActiveUsers :"& Application("ActiveUsers")
nasty errors...
ASKER
manihopever,
I get no output, it looks like its not calling the sub routine in the global.asa, thats what I don't understand.
I put the global.asa under the scripts/xyz directory and called a page from that directory, and no output, thats the weird part. In IIS.5.0(Win2K) not problems in IIS 4.0 NT.= junk.
I get no output, it looks like its not calling the sub routine in the global.asa, thats what I don't understand.
I put the global.asa under the scripts/xyz directory and called a page from that directory, and no output, thats the weird part. In IIS.5.0(Win2K) not problems in IIS 4.0 NT.= junk.
I stand corrected..I was 99% sure you couldn't have reponse.write in the global.asa, but I've just tested using w2k and it works! (Maybe in NT4 it's different).
I still believe you haven't created a seperated application.
And finally you did call it global.asa NOT global.asp??
I still believe you haven't created a seperated application.
And finally you did call it global.asa NOT global.asp??
ASKER
Ruperts, I created the application and then global.asa worked fine. Weired in Win2k, there is not need. Thanks guys for all of your help and input.
Sub Session_OnStart
Session.Timeout = 20
Session("Start") = Now
Application.Lock
Application("ActiveUsers")
Application.UnLock
End Sub
Sub Session_OnEnd
Application.Lock
Application("ActiveUsers")
Application.unlock
Also..On the website properties click on Configuration->App Options -> Enable Session State (Checked)