Call this method on page load for clearing cache
public void ClearApplicationCache()
{
List<string> keys = new List<string>();
IDictionaryEnumerator enumerator = Cache.GetEnumerator();
while (enumerator.MoveNext())
{
keys.Add(enumerator.Key.ToString());
}
for (int i = 0; i < keys.Count; i++)
{
Cache.Remove(keys[i]);
}
}
public void ClearApplicationCache()
{
List<string> keys = new List<string>();
IDictionaryEnumerator enumerator = Cache.GetEnumerator();
while (enumerator.MoveNext())
{
keys.Add(enumerator.Key.ToString());
}
for (int i = 0; i < keys.Count; i++)
{
Cache.Remove(keys[i]);
}
}
No comments:
Post a Comment