Use HttpContext.Current.Cache.

--
James J. Foster, DotNetCoders
[url]http://www.dotnetcoders.com[/url]

"STom" <stombiztalker@hotmail.com> wrote in message
news:uhI632DYDHA.656@tk2msftngp13.phx.gbl...
> I am using the Cache object within some of my user controls to store data
> tables.
>
> I would like to have some sort of a global area to put the data into the
> cache for use, but when I go to use the Cache object in global.asax or any
> other file other than something derived from Page or UserControl, I get an
> error saying that Cache is not declared.
>
> I have imported System.Web.Caching namespace but that doesn't help.
>
> What is the best way to use the cache, and fill it externally of the
> page/control I am working on?
>
> Thanks.
>
> STom
>
>