how to matain cache time for 2 minutes

Posted by Surisetti.rajesh under Regular Expressions on 4/13/2010 | Views : 1520 | Status : [Member] | Replies : 1
how to matain cache time for two minitues when button click




Responses

Posted by: Pavanandey on: 4/13/2010 [Member] Bronze

Up
0
Down

dataset ds = new dataset();

HttpContext.Current.Cache.Insert("CacheName", ds, null, DateTime.Now.AddMinutes(1), Cache.NoSlidingExpiration);

here the dataset is kept in cache with name CacheName , with the time for 1 min.

while Reterving

ds= (DataSet)HttpContext.Current.Cache["CacheName"];

Thanks
Pavan Kumar
Mark Answer if this fits the need

Surisetti.rajesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response