How to get to Cache from Class

  • Thread starter Thread starter Keith Chadwick
  • Start date Start date
K

Keith Chadwick

Need some help on access the httpApplication cache.

I was informed to use the application cache over the old application object
and also to use a classes versus modules.

do I need to Imprt System.Web.HttpApplication into the class?

do I need to dim x as System.Web.Application then use
x.context.cache.item("myitem")=myobject

How exactly do I get to the application cache from within a class as none of
the above seems to work?

Thanks
Keith
 
The Application Cache is a property of the Current HttpContext. When
referring to the Application Cache in a Page, you can simply refer to
"Cache," as it is a property of the Page class If you are referring to the
Application Cache in a class that is not a Page or HttpHandler, but is used
by one, you can refer to "HttpContext.Current.Cache."

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.
 
Back
Top