hi,

i have created a list of objects and after filling the list i am assigning that list to a cache for later use. now when i later try to re-cast my cache to the underlying list the cache giving me null value.
i am using the technique as below.
cache["abc"] = listObject;
then at some other point i am using the following code snippt to get list data from cache.
listobject = (List<T>)cache["abc"];
but this return me null...
please help me how can i fixed it.


Thanks and Regards,
Nice Candy.

The ASP.NET can remove data from the cache when:

1. Memory on server is low
2. Cache is expired etc.

You must have to use Cache Early; Cache Often technique to avoid such problems.

if(Cache["key"]==null){
   //create cache entry
   Cache["key"]=value;
}
....
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.