I have a CachedControl.ascx user control which uses output cache. Let this user control reside in a ASP.NET page called Container.aspx.
I want to be able to clear the user control's output cache programmatically from another page called ClearCache.aspx.
(for example when doing a data change in an administration page, the user control output cache in the store side should be cleared to reflect the newest data, before waiting the cache to expire)
I found that HttpResponse.RemoveOutputCacheItem("absolute virtual path") method is supposed to do this work, but it did not work for my situation.
It seems it is working to clear a full aspx output cache from another page.
The cache clearing code in the ClearCache.aspx is:
A.Venkatesan
Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com
Already i saw those websites. The problem is i must be able to remove a user control from the cache. The one you are referring will remove the pages from the cache.
A.Venkatesan
Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com
alekhine_x9
Member
147 Points
37 Posts
Clear user control output cache from another page
Apr 04, 2007 06:34 AM|LINK
I have a CachedControl.ascx user control which uses output cache. Let this user control reside in a ASP.NET page called Container.aspx.
I want to be able to clear the user control's output cache programmatically from another page called ClearCache.aspx.
(for example when doing a data change in an administration page, the user control output cache in the store side should be cleared to reflect the newest data, before waiting the cache to expire)
I found that HttpResponse.RemoveOutputCacheItem("absolute virtual path") method is supposed to do this work, but it did not work for my situation.
It seems it is working to clear a full aspx output cache from another page.
The cache clearing code in the ClearCache.aspx is:
HttpResponse.RemoveOutputCacheItem(Page.ResolveUrl("~/Container.aspx"))
I also tried
HttpResponse.RemoveOutputCacheItem(Page.ResolveUrl("~/CachedControl.ascx"))
Is there a solution to my problem?
OutputCache
alekhine_x9
Member
147 Points
37 Posts
Re: Clear user control output cache from another page
Apr 13, 2007 01:23 PM|LINK
Suprised that not a single answer posted to my question.
I just wonder whether it is possible or not to clear a user control output cache from another page.
Where are those MVP's? This is a very common scenario in a web app.
YPhyu
Member
19 Points
9 Posts
Re: Clear user control output cache from another page
Jan 18, 2008 10:07 AM|LINK
I am facing the same problem. Have you find any solution yet?
Thanks
YPhyu
Member
19 Points
9 Posts
Re: Clear user control output cache from another page
Jan 18, 2008 12:29 PM|LINK
I have had a solution from this url:
http://aspadvice.com/blogs/joteke/archive/2007/10/31/ASP.NET_3A00_-clear-user-control-output-cache.aspx
naan cloud
Member
20 Points
13 Posts
Re: Clear user control output cache from another page
Feb 29, 2012 04:26 AM|LINK
I am also need a solution for this. Does any one found a solution for this?
venkatmca008
Participant
1810 Points
341 Posts
Re: Clear user control output cache from another page
Feb 29, 2012 04:59 AM|LINK
hi..please refer this..and let me know..
http://aspalliance.com/668
response.expires = 0 response.cache.setnostore() response.appendheader("Pragma", "no-cache")Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com
naan cloud
Member
20 Points
13 Posts
Re: Clear user control output cache from another page
Feb 29, 2012 07:21 AM|LINK
Already i saw those websites. The problem is i must be able to remove a user control from the cache. The one you are referring will remove the pages from the cache.
venkatmca008
Participant
1810 Points
341 Posts
Re: Clear user control output cache from another page
Feb 29, 2012 07:25 AM|LINK
hi...refer this to clear user control from cache
http://forums.asp.net/t/1588121.aspx/1
Microsoft Certified Professional
Please mark the replies as answers if they help or unmark if not.
If you have any feedback about my replies, please contact venkatmca008@gmail.com