Caching a user control

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I have a user control that is used on many of our web pages. I'd like to
cache it so that it doesn't have to be recreated for each page. The syntax
below only caches the User Control for each page that uses it. I want it
cached for ALL pages that use it plus for all concurrent sessions.

Is there a way to do this? Thanks in advance.
-Mark

<%@ OutputCache Duration="120" VaryByParam="None" %>
 
Hi Mark:

Add:

Shared="true"

to the @ OutputCache directive. The default value is false. By setting
the value to true the cached user control output can be accessed by
multiple Web Forms pages.

HTH,
 
Back
Top