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
精彩评论