Re: Accessing Cache from Custom Web Server Control
- From: "Jordan S." <A@xxxxx>
- Date: Fri, 30 May 2008 21:55:35 -0700
Got it... I was referencing System.Web... but was missing the using
statement.... (Doh!....)
Thanks.
"Joe" <bbgbouncer@xxxxxxxxx> wrote in message
news:e28a7d10-ba09-4425-add5-8efd8fef958c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Your just missing a reference. HttpContext.Current.Cache is the same
object. You can also use HttpRuntime.Cache. Little less overhead when
using this one.
I believe they are in System.Web
-joe
On May 30, 8:28 pm, "Jordan S." <A...@xxxxx> wrote:
"Peter Bucher [MVP]" <peter.buc...@xxxxxxxxxxxxx> wrote in
messagenews:u8CL7EswIHA.1436@xxxxxxxxxxxxxxxxxxxxxxx
Hello Jordan S.
How can I access the same Cache from *within* a custom composite WebTwo Ways:
server control I'm writing (that lives in it's own assembly) that is
dynamically added to a page at runtime? What do I need to do with the
custom control or it's containing assembly to enable it to access the
Cache of the hosting Web application?
HttpContext.Current.Cache
this.Page.Cache
both gives the same Reference to the current Cache Object.
Unfortunately neither of your suggestions works in my case. I want to
access
the Cache from *within* a web server control. There is no "this.Page"
reference in a web server control.
The suggestion for HttpContext.Current.Cache seems promising, but it's
currently not available in my control's class.
Am I just missing some reference? The project/assembly within which my
control exists references System.Web. What else do I need to reference -
or
what do I need to do to be able to access teh current context from within
a
custom control?
Thanks.
.
- References:
- Accessing Cache from Custom Web Server Control
- From: Jordan S.
- Re: Accessing Cache from Custom Web Server Control
- From: Peter Bucher [MVP]
- Re: Accessing Cache from Custom Web Server Control
- From: Jordan S.
- Re: Accessing Cache from Custom Web Server Control
- From: Joe
- Accessing Cache from Custom Web Server Control
- Prev by Date: Getting the membership username
- Next by Date: Code library
- Previous by thread: Re: Accessing Cache from Custom Web Server Control
- Next by thread: How to prevent FileUpload from uploading on Prev click in a wizard?
- Index(es):
Relevant Pages
|