First, when you reference Application["data"] you're not referencing the
Application Cache; you're referencing the Application Collection. Generally
speaking, you should be using the Application Cache, for which the syntax
would be Cache["data"]. The Application Collection is really there for
backwards compatibility and is not threadsafe.
To reference any HttpContext-specific object in a class which doesn't
inherit System.Web.UI.Control, you would refer to
System.Web.HttpContext.Current to accesss it. For example, to reference the
Application Cache "data" item, you would refer to
System.Web.UI.HttpContext.Current.Cache.
--
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"KaaN" <ka*********@yahoo.com> wrote in message
news:fe*************************@posting.google.co m...
hi,
in an asp.net application, i can not access the server-side
application data using,
cachedata = Application["data"];
when it is not a page behind class. can i use the cache in another
class of the application for example in myutils.cs which is not a page
behind class?