Link to home
Start Free TrialLog in
Avatar of Lico_w
Lico_w

asked on

How do you set Global variables in classic ASP pages?

I need to set variables in an ASP app that are set to static values. So that when the app switches between pages via POSTs and GETs etc. it can still call them. How do I do this
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

You would have to use either the Session (user scoped) or Application (application scoped) variables:
<%
     Application("SomeGlobalValue") = "someValue"        '// scoped to the application
     Session("SomeUserValue") = "someValue"               '// scoped to the current user
%>

Open in new window

Avatar of Lico_w
Lico_w

ASKER

What about if its an array or number?

Also how would you then call it in the code?
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial