[thelist] (asp.net) application variables
Tab Alleman
talleman at Lumpsum.com
Wed Mar 22 15:01:01 CST 2006
Do you mean am I sure that's the line of code that's triggering the error? if so, then yes.
No other object called application anywhere in the page scope...
Response.Write(Application("foo")) produces nothing.
I did work around the problem by using a Static Variable instead, but it'd be nice to figure this out for future reference.
> -----Original Message-----
> From: thelist-bounces at lists.evolt.org
> [mailto:thelist-bounces at lists.evolt.org]On Behalf Of Peter Brunone
> (EasyListBox.com)
> Sent: Wednesday, March 22, 2006 3:53 PM
> To: thelist at lists.evolt.org; thelist at lists.evolt.org
> Subject: Re: [thelist] (asp.net) application variables
>
>
>
> Bear with me, but are you sure that's the line
> it's marking?
>
> Also, is there perchance another object in page scope called
> "application"? That would seem to be more likely to throw an
> ambiguous name error, but this IS left over from Classic...
>
> Peter
>
> 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?
> --
>
> * * 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