I put some 'constants' in the Application object. 99.99% of the time, I have no problems in retrieving them using
in ASPX pages, but there are a few instances when the Get returns null (when it shouldn't do).
FYI, items were put into Application object as follows:
The values were obtained using:
CONST is null in one or two instances, but when the ASPX page reloads, it works again.
Using ASP.NET on IIS5.0 on Windows Server 2000.
Code:
Application.Get
FYI, items were put into Application object as follows:
Code:
'global.asax.vb:
Imports System.Web
Imports System.Web.SessionState
Public Class Global
Inherits System.Web.HttpApplication
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
Application.Add("key", "Value being a String")
End Sub
End Class
The values were obtained using:
Code:
Within an ASPX page in embedded JavaScript, embedded as:
var CONST;
function window.onload()
{
CONST = <%= Application.Get("key")%>;
}
CONST is null in one or two instances, but when the ASPX page reloads, it works again.
Using ASP.NET on IIS5.0 on Windows Server 2000.