开发者

How to implement caching for the whole page except user control?

I have aspx page with a user control. I want to implement caching for the entire page except the user contr开发者_如何学运维ol. Please any help to implement this.

Thanks,

Pradeep


There is a control callen Substitution which displays dynamic data on location in a cached page. However the data is retrieved from a function contained in the page code behind not a user control.

An alternate solution would be do to the following:

Split your page in sections. Each section is represented by a user control.

The sections which must be cached have the output cache of their control enabled. The ones that need to be dynamic not.

You could get something like this:

<body>
<app:CachedSection />
<app:CachedSection />
<app:DynamicSection />
<app:CachedSection />
</body>


Scott Guthrie has a great article about ASP.NET's Substitution features (aka Donut Caching):

http://weblogs.asp.net/scottgu/archive/2006/11/28/tip-trick-implement-donut-caching-with-the-asp-net-2-0-output-cache-substitution-feature.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜