Global variables on par with ASP's global.asa

  • Thread starter Thread starter Wayne
  • Start date Start date
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.
 
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
 
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
 
Back
Top