Thursday, June 21, 2012

Using Cache in ASP.NET


if (Cache["Name"] != null)

Label1.Text = "Hello," + (string)Cache["Name"];

else

Label1.Text = "Hello, guest! ";


Setting Cache Expiry


Cache.Insert("Name", "Kevin", null, DateTime.Now.AddMinutes(10), TimeSpan.Zero);



No comments:

Post a Comment