0

I have a asp.Net page with a menu of 3 items. Each of the 3 points to a sub-menu, where the sub-menu becomes visible once it is selected from the main menu. I moved an item from the default sub-menu (the first of the 3) to a different sub-menu. Although the menu item appears in its new location when the page is rendered (and its code-behind works aok), the option persists in the old location on the default sub-menu. We are using IIS 7.

Rebooting didn't help. Correct me if I am wrong but I think the page is being cached and that I need to clear this cache.

How do I go about doing this? What has happened here?

Thank you for your help and patience.

DeveloperM
  • 1,129
  • 7
  • 17
  • 30
  • @DanRayyy - we are an IE shop. – DeveloperM Jan 12 '15 at 17:29
  • will setting the page to be not cache-able work? instructions: http://stackoverflow.com/questions/914027/disabling-browser-caching-for-all-browsers-from-asp-net – rogerdeuce Jan 12 '15 at 19:00
  • Add a ?v=2 or any random query string paramater as a version to the page or the .js you are using. This lets the cache think it is another page. – Pleun Jan 12 '15 at 19:53

1 Answers1

-2

Try the code below:

For Each de As DictionaryEntry In HttpContext.Current.Cache
   HttpContext.Current.Cache.Remove(DirectCast(de.Key, String))
Next

If that doesn't work,

IDictionaryEnumerator enumerator = HttpContext.Current.Cache.GetEnumerator();

while (enumerator.MoveNext())

{

    HttpContext.Current.Cache.Remove(enumerator.Key);

}

Note that, this technique is not efficient for pages with OutputCache type. for clearing this type cached memory, you should use below code line.

HttpRuntime.Close();
DanRayyy
  • 1
  • 1