server side script ignored

J

jopek

pardon the simple question


I am just getting into ASP and i am having a bit of a problem.
If I set variables in the Application_OnStart() in the global.asa which
is run on the server and then I try to display or use the variables in a
page the variables do not seem to exist.
I get the same problem even if I run examples from the wrox ProAsp 3.0
book.

An example would be:

in global.asa or within test.asp

<% LANGUANGE="VBScript" runat="server" %>
<Script>
sub Application_onStart()
Application("Name") = "test"
end sub
</Script>

test.asp

..
..
..
<H1> Application Name: <% = Application("Name") %> </H>
..
..
..

The only thing displayed is the "Application Name:"

Is this a configuration problem?


thank you for your help

john
 
V

Vilmar Brazão de Oliveira

Hi,
I use global.asa thus:
<script language="VBScript" runat="Server">
Sub Application_OnStart
Application("VisitantesAtivos") = 0
Application("TotalVisitas") = 0
End Sub

Sub Application_OnEnd
End Sub

Sub Session_OnStart
Application.Lock
Session.Timeout = 60 '»»60 min. = 1 h. Tempo de expiração da session padrão
no site da hi-tec.
Application("VisitantesAtivos") = Application("VisitantesAtivos") + 1
Application("TotalVisitas") = Application("TotalVisitas") + 1
Application.UnLock
End Sub

Sub Session_OnEnd
Application.Lock
Application("VisitantesAtivos") = Application("VisitantesAtivos") - 1
Application.UnLock
End Sub

</script>
-----------------------------
so you can write the values in any places of you asp application:
<%=Application("VisitantesAtivos")%>

bye,

--

Sem mais,

««««««««»»»»»»»»»»»»»»
Vlmar Brazão de Oliveira
Desenvolvimento Web
HI-TEC
 
B

Bob Barrows [MVP]

jopek said:
pardon the simple question


I am just getting into ASP and i am having a bit of a problem.
If I set variables in the Application_OnStart() in the global.asa
which is run on the server and then I try to display or use the
variables in a page the variables do not seem to exist.
I get the same problem even if I run examples from the wrox ProAsp 3.0
book.

An example would be:

in global.asa or within test.asp

<% LANGUANGE="VBScript" runat="server" %>
<Script>
sub Application_onStart()
Application("Name") = "test"
end sub
</Script>

Have you restarted the application since adding this code to the global.asa?
Usually it's not necessary, but, it can't hurt to try.

Bob Barrows
 
J

jopek

thanks for the response.
I did try that a few times.
This doesn't seem to make sense.

J
 
J

jopek

Thank you for your response.

I have almost the exact code you have and it
still does not work!

Strange!!!
 
M

Mark Schupp

Is the directory containing the global.asa file defined as an application in
IIS (icon in IIS manager should be an activeX "ball" in a box)?
 
J

jopek

Mark,

thank you.
Okay, I just realized my problem. I was trying to run the site from
Interdev. when I run the site/app from a ie it works fine.
So, what is the secret to getting this to work within Interdev?

thanks again


John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top