Global variables on par with ASP's global.asa

W

Wayne

I have googled etc for details on using global variables in the global.asax
file in much the same manour as that in global.asa, and have come across
some sites suggesting the use of:
<object id='id' runat='server' classid='Namespace.Class'
scope='Application'/>

However, nothing happens, and when used in the context of the current
application it just returns "Object not Defined".

I have looked at the HttpApplicationState class, but the level of
information returned by the object that I need global actually complicates
the use if HAS.
 
C

charles

Just say Application["myVariable"] = someObject. (and cast it to get it
back).

The <object... > mechanism you tried also uses the HttpApplicationState
object but seems more complex

charles
 
W

Wayne

charles said:
Just say Application["myVariable"] = someObject. (and cast it to get it
back).

The <object... > mechanism you tried also uses the HttpApplicationState
object but seems more complex

charles

That is what I feared - but it does work very well; even to the point I can
access that Object's members et-al.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,829
Latest member
PIXThurman

Latest Threads

Top