I'm trying to just output the global.asa Application("SiteURL"), but I get nothing showing for SiteURL. I have it defined in the global.asa as
<!--METADATA TYPE="TypeLib" FILE="c:\Program Files\Common Files\System\ado\msado15.dll" -->
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub Application_OnStart
Application("SiteURL") = "http://[localhost]/asp3test/"
Application("myAppVariable") = "Apple"
Application("CurrentDateTime") = ""
End Sub
</SCRIPT>
This is my test.asp file:
<BODY>
Let's retrieve the values of the Application Variables:<P>
myAppVariable = <%= Application("myAppVariable")%><BR>
SiteURL = <%= Application("SiteURL")%> <br />
CurrentDateTime = <%= Application("CurrentDateTime")%><br />
Now, let's set the variables:<HR>
<%
Application.Lock
Application("CurrentDateTime") = Now
Application.UnLock
%>
Variables set - <A HREF="test.asp">click here</A> to reload the page to view
</BODY>
Result:
Let's retrieve the values of the Application Variables:
myAppVariable =
SiteURL =
CurrentDateTime = 12/22/2013 1:47:42 PM
Now, let's set the variables:
The values that are set in the Global.asa file do not seem to be grabbed, like it is not being read (processed), but when I manually set the values to a Application(variable), it seems to hold it. So something missing with with Global.asa is not being read. I am on IIS 7.5.76 and Win7(64bit), not sure if that helps.