Click here to Skip to main content
15,888,007 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi ,
please let me know how to Get all the values from HttpContext.Current.Cache as
i doesn"t know the keyname to specify in get method of HttpContext.Current.Cache

ie HttpContext.Current.Cache.Get
Posted
Updated 3-Jul-11 20:36pm
v3

Try that way

C#
foreach (DictionaryEntry item in HttpContext.Current.Cache)
           {
               Response.Write("Key " + item.Key + ", Value " + item.Value);
           }
 
Share this answer
 
Try like following code.

C#
IDictionaryEnumerator CacheEnum = HttpContext.Current.Cache.GetEnumerator();
            while (CacheEnum.MoveNext())
            {
                var cacheItem = Server.HtmlEncode(CacheEnum.Current.ToString());
                Response.Write(cacheItem);
            }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900