[thelist] (asp.net) application variables

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Wed Mar 22 14:54:04 CST 2006


		Also, what happens if you just Response.Write(Application("foo")) ?

				From: "Tab Alleman" talleman at Lumpsum.com

I'm having trouble storing and accessing a simple application variable in asp.net.

In my global.ascx file, I've got this:

Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the application is started
Application("foo") = "some text"
End Sub

and then in one of my pages, I've got this:

strFoo = Application("foo")

which produces the error: "Reference to a non-shared member requires an object reference".

What am I doing wrong? Should I be "NEW"-ing the Application somewhere? where?



More information about the thelist mailing list