c# - Asp.Net OutputCache and Expiration -


"postprint" itemprop = "text">

I used the Asp.net OutputCache on certain pages when I want to edit a user page containing a usercontrol I'm able to expire the page cache and reload the page from fresh data.

Is there any way I can do this from usercontrol?

If not, what are some other ways to caching the page which will allow me to edit this way.

----------- Edit -----------

After some more research I work a method well Seems to find that

  dim cachekey string = String.Format ("Calendar- {0}", calendarID) as HttpContext.Current.Cache. Insert (cachekey, DateTime.Now, nothing is, System.DateTime.MaxValue, System.TimeSpan.Zero, System.Web.Caching.CacheItemPriority.NotRemovable, Nothing) Response.AddCacheItemDependency (cachekey)  

This page will add dependency to the cache object, and then to finish I do this:

  dim cachekey string = string.format ("Calendar - {0} ", CalendarID) HttpContext.Current.Cache.Insert (cachekey, DateTime.Now, nothing is, System.DateTime.MaxValue, System.TimeSpan.Zero, System.Web.Caching.CacheItemPriority.NotRemovable, something Even if not)  

So far the dependency cache Minister is known as may conclude a page.

You can try this:

  Private Zero RemoveButton_Click (object Sender, System.EventArgs e) {HttpResponse.RemoveOutputCacheItem ("/ caching / CacheForever.aspx"); }  

to:

thanks.


Comments