Object Caching

Reply Forum
Forum postBasumitra Mitra @ 2011-04-08 11:00:45
ReplyReply to
I wrote the following in my Default.aspx.cs file as stated in the tutorial :

protected void Page_Load(object sender, EventArgs e)
{
ArrayList datestamps;
if(Cache["datestamps"] == null)
{
datestamps = new ArrayList();
datestamps.Add(DateTime.Now);
datestamps.Add(DateTime.Now);
datestamps.Add(DateTime.Now);

Cache.Add("datestamps", datestamps, null, System.Web.Caching.Cache.NoAbsoluteExpiration, new TimeSpan(0, 0, 60), System.Web.Caching.CacheItemPriority.Default, null);
}
else
datestamps = (ArrayList)Cache["datestamps"];

foreach(DateTime dt in datestamps)
Response.Write(dt.ToString() + "<br />");
}
The tutorial told that no change should be done in markup file. Accordingly I executed the file and got the following error message:

Error 1 The type or namespace name 'ArrayList' could not be found (are you missing a using directive or an assembly reference?)

My question is how to rectify that error











© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com