PC Review


Reply
Thread Tools Rate Thread

Accessing Web Application Cache in Class Library

 
 
Fred Nelson
Guest
Posts: n/a
 
      12th Jun 2006
Hi:

Newby Question (hopefully):

I would very much like to be able to read and update application cache
values directly in a class library. I have added the reference to my
class lib:

using System.Web.Caching;

however this doesn't work - is there a way to do this?

The command:

Cache["mykey"] = "my string value"

Generates the following error in my class lib:

'System.Web.Caching.Cache is a type but is used like a variable'

however it works just fine when coded on web forms.

Any help would be appreciated!

Thanks very much!

Fred
 
Reply With Quote
 
 
 
 
Fred Nelson
Guest
Posts: n/a
 
      13th Jun 2006
Hi All:


The way to do this is to use:

HttpRuntime.Cache in the class!

Fred



Fred Nelson wrote:

> Hi:
>
> Newby Question (hopefully):
>
> I would very much like to be able to read and update application cache
> values directly in a class library. I have added the reference to my
> class lib:
>
> using System.Web.Caching;
>
> however this doesn't work - is there a way to do this?
>
> The command:
>
> Cache["mykey"] = "my string value"
>
> Generates the following error in my class lib:
>
> 'System.Web.Caching.Cache is a type but is used like a variable'
>
> however it works just fine when coded on web forms.
>
> Any help would be appreciated!
>
> Thanks very much!
>
> Fred


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: problem accessing Context from class library Chad.Burggraf@gmail.com Microsoft ASP .NET 0 4th Jan 2007 10:21 PM
VB .NET Class Library accessing a legacy C DLL Jason Microsoft VB .NET 0 12th Sep 2005 07:48 PM
Re: Accessing Class library from different path. Murali Microsoft ASP .NET 0 21st Sep 2004 01:35 PM
Class Library accessing Application object William Gower Microsoft ASP .NET 2 27th Jul 2004 03:37 AM
accessing the Cache in non-Page class sklett Microsoft ASP .NET 1 30th Jan 2004 04:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:50 PM.