开发者

how to cache only the content page

开发者 https://www.devze.com 2023-04-07 04:09 出处:网络
I\'ve got a master page with a content page loaded on to it, the content page is cached <%@ OutputCache Duration=\"360\" VaryByParam=\"none\"%>

I've got a master page with a content page loaded on to it, the content page is cached

<%@ OutputCache Duration="360" VaryByParam="none"  %>

in the master page iv'e got a login control above the content , now if i attempt to use the control nothing happens since the content and the master binned to it are cached so the Response is redirect .

  1. How could i cache only the content ?
  2. Or alternately how can i make it so the login event refreshes the

    cached content page?

OK : Adding my attempts to resolve the situation

(1) iv'e declared an OutputCache directive in the User Con开发者_如何学Gotrol itself the problem now is that it wasn't recognized (it's null) when i redirect to other pages so i added the shared attribute to its directive

 <%@ OutputCache Duration="360" VaryByParam="none" Shared="true" %>

but it's still null when redirecting to different pages.


Well, a wild idea which comes to my mind first is to put that dynamic content in a separate page and then reference it as <iframe> on your master page.

It will cache all of the things but won't cache the content of the iframe.

Also have a look at below document :

Caching Portions of an ASP.NET Page

http://msdn.microsoft.com/en-us/library/h30h475z.aspx

0

精彩评论

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