Hi,
Can any of the experts here help me with this? I have an aspx page with a few user controls which has the <%outputcache%> set to cache the for anything between 30s to an hour depending on the nature of their content. While clearing the outputcache of a page is relatively easy, I can't seem to find a way to clear the cache for User Controls. I've tried the code given here http://www.syncfusion.com/FAQ/aspnet/WEB_c25c.aspx as well as other places (there aren't many anyway) and they doesn't seem to work.
Many thanks in advance.
RegardsCK
Try to call HttpResponse.RemoveOutputCacheItem("< virtual path of your user control>"); in non output-cached page. You can use Response.Cache.AddValidationCallback() as alternative too.
Hope this helps...
Hi,Tried the HttpResponse.RemoveOutputCacheItem() but it appears to work only with .aspx pages, not UserControls. :(
Have you tried
Cache.Remove(myUserControl.UniqueID)
If that is not the correct cache key, you may have to resort to using the Cache Viewer tool (below) to determine the exact key name used by the ASP.NET runtime
http://authors.aspalliance.com/aldotnet/examples/cacheviewer.aspx
The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral
hi,
can you try following
me.Cache.Remove(me.ClientID.ToString())
regards,
satish