Caching a user control

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" %>
 
S

Scott Allen

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top