How to get to Cache from Class

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
 
K

Kevin Spencer

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.
 

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,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top