How to use Cache in Class files?

Posted by SheoNarayan under ASP.NET category on | Views : 4251

// Removing data from cache

// Storing data into cache
System.Web.HttpContext.Current.Cache["Mydata"] = MyObject; // this can be a string, or any object

// Getting data from cache
object obj = System.Web.HttpContext.Current.Cache["Mydata"];

Comments or Responses

Login to post response