Re: Accessing Cache from Custom Web Server Control

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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 Web
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?
Two Ways:

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.




.



Relevant Pages

  • Re: Validation rule problem
    ... To check for a missing or broken reference open the VBA window at any code ... expression Before Update you entered as the event property setting produced ...
    (microsoft.public.access.gettingstarted)
  • Re: How to set default date format in Access 07
    ... If the code compiles then there is probably no problem at all in unchecking/claering the missing reference. ... It the code does not compile, then you either have to track down the missing library or locate the code that is broken. ... Doug Steele, Microsoft Access MVP ... Do I put the =Dateas the default value in the control on the ...
    (microsoft.public.access.gettingstarted)
  • Re: VBA Script from Win2000 not working in XP
    ... I removed the reference from the version on the XP machine and now the app ... It'll need some more testing to ensure nothing's missing. ... >> Microsoft Access 11.0 Object Library ...
    (microsoft.public.access.security)
  • Re: Recordsetclone stopped working.
    ... I have a control with an If statement including ... Is there perhaps a reference book I deleted or something that is ... Uncheck it, recheck it, close and open Access. ... If none are MISSING, check any reference; ...
    (microsoft.public.access.forms)
  • Re: "Compile Error Cant find project or library."
    ... In this case you will get the Missing designation as ... does not exist on the host machine. ... the version of the reference on the machine you are creating on, ...
    (microsoft.public.excel.programming)