Solved

Global.asp question

Posted on 2002-03-03
15
278 Views
Last Modified: 2008-03-10
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("ActiveUsers")%>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>
 
0
Comment
Question by:7of9121098
  • 6
  • 5
  • 2
  • +1
15 Comments
 
LVL 4

Expert Comment

by:ruperts
ID: 6837957
Firstly..

Sub Session_OnStart
Session.Timeout = 20
Session("Start") = Now
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") + 1
Application.UnLock
End Sub

Sub Session_OnEnd
Application.Lock
Application("ActiveUsers") = Application("ActiveUsers") - 1
Application.unlock

Also..On the website properties click on Configuration->App Options -> Enable Session State (Checked)
0
 
LVL 4

Expert Comment

by:ruperts
ID: 6838001
And finally make sure you've created a separate application in IIS.
0
 
LVL 2

Expert Comment

by:manihopever
ID: 6838413
First create a seperate virtual directory and try once.
0
 

Expert Comment

by:bsimmons
ID: 6838533
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?
0
 

Author Comment

by:7of9121098
ID: 6839361
properties click on Configuration->App Options -> Enable Session State (Checked) ARE CHECKED.
0
 

Author Comment

by:7of9121098
ID: 6839417
bsimmions, no error but when I use the
<%=Application("ActiveUsers")%> doen't print out anything.
 
0
 
LVL 4

Expert Comment

by:ruperts
ID: 6839627
What about creating a separate application in IIS?
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:7of9121098
ID: 6839634
What do you mean by creating a separate application in IIS?
0
 
LVL 4

Accepted Solution

by:
ruperts earned 50 total points
ID: 6839645
Right click on the folder in the IIS manager

Then click on Properties

On the first panel press "Create" next to the grayed out "Default Application"


Apply..
0
 

Expert Comment

by:bsimmons
ID: 6840806
I totally agree.  That should do it.
0
 
LVL 2

Expert Comment

by:manihopever
ID: 6841048
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.
0
 
LVL 4

Expert Comment

by:ruperts
ID: 6842941
manihopever:

I can tell you what this will give you..

response.write "ActiveUsers :"&  Application("ActiveUsers")

nasty errors...

0
 

Author Comment

by:7of9121098
ID: 6842998
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.
0
 
LVL 4

Expert Comment

by:ruperts
ID: 6843831
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??
0
 

Author Comment

by:7of9121098
ID: 6844625
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.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now