Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

ASP.NET: Clear all Cached objects

From Wiki

Jump to: navigation, search

Summary: An example of how to clear all cached objects

The Cache doesn't have a Clear method so you have to loop through each item and Remove each key:

  1. Dim CacheEnum As IDictionaryEnumerator = Cache.GetEnumerator
  2.  
  3. While CacheEnum.MoveNext  
  4.     Cache.Remove(CacheEnum.Key.ToString)  
  5. End While

This Hack is part of the ASP.NET Hacks collection

431 Rating: 3.0/5 (5 votes cast)