Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2006, 06:31 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to TrivediVishal
Default System.Web.Caching.Cache Error

Hello all,

I am using the below code in one of my pages:

Quote:
quote:
if (Cache["DateList"] == null)
{
     System.Data.IDataReader DateReader = Data.Dates();

     while (DateReader.Read())
     {
           DateList[DateReader["Date"]] = DateReader["Date"];
     }

     DateReader.Close();

     Cache.Insert("DateList", DateList, null, DateTime.Now.AddMinutes(1), Cache.NoSlidingExpiration);
}
Upon executing the above code, I am getting the below error:
Quote:
quote:
 Compiler Error Message: CS0118: 'System.Web.Caching.Cache' is a 'type' but is used like a 'variable'

Source Error:
Line 31: if (Cache["DateList"] == null)
Can anyone please help?

Thanks?

-Vishal

 
Old April 18th, 2006, 07:18 AM
Registered User
 
Join Date: Apr 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to TrivediVishal
Default

I figured out the problem. I was using incorrect code.

Thanks,

-Vishal

 
Old December 18th, 2006, 06:58 PM
Authorized User
 
Join Date: Jun 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to drdexter33 Send a message via MSN to drdexter33
Default

how did you fix this error?

Thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Web Error snowy0 VB.NET 2002/2003 Basics 12 October 14th, 2006 11:13 PM
error system.web....... anpham ASP.NET 1.0 and 1.1 Basics 3 July 1st, 2005 01:36 PM
Cache certain portions of web page itHighway Classic ASP Basics 2 April 21st, 2005 01:14 AM
Cache dependency on a web file madkaikar_ashish General .NET 0 February 16th, 2005 12:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.