[thelist] (asp.net) application variables

Robert Vreeland vreeland at studioframework.com
Wed Mar 22 13:40:26 CST 2006


Not sure about VBScript, but in c# I'm currently using the following in the
aspx page
(string )ConfigurationSettings.AppSettings["sqlConnectionString"]

Hope it helps,
Robert

-----Original Message-----
From: thelist-bounces at lists.evolt.org
[mailto:thelist-bounces at lists.evolt.org] On Behalf Of Tab Alleman
Sent: March 22, 2006 02:22 PM
To: Evolt Thelist (E-mail)
Subject: [thelist] (asp.net) application variables

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?
-- 

* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester and archives
of thelist go to: http://lists.evolt.org Workers of the Web, evolt ! 




More information about the thelist mailing list