protected void Page_Load(object sender, EventArgs e)
{
string key = "KEY";
string str = "A";
Cache.Add(key, str, null,
System.Web.Caching.Cache.NoAbsoluteExpiration,
new TimeSpan(0, 10, 0), CacheItemPriority.High,
null);
str = "B";
Cache.Add(key, str, null,
System.Web.Caching.Cache.NoAbsoluteExpiration,
new TimeSpan(0, 10, 0), CacheItemPriority.High,
null);
Response.Write("<li />Test1=" + Cache[key].ToString());
str = "C";
Cache.Insert(key, str, null,
System.Web.Caching.Cache.NoAbsoluteExpiration,
new TimeSpan(0, 10, 0), CacheItemPriority.High,
null);
str = "D";
Cache.Insert(key, str, null,
System.Web.Caching.Cache.NoAbsoluteExpiration,
new TimeSpan(0, 10, 0), CacheItemPriority.High,
null);
Response.Write("<li />Test2=" + Cache[key].ToString());
}