View Single Post
  #9 (permalink)  
Old January 23rd, 2012, 07:43 PM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

You get these at development time, not at run-time right? That means something is wrong.... ;-)

I can see a few possible reasons for this problem:

1. Your ASPX page is called Mileage as well. This may or may not cause a name conflict with your mileage class. Try create a new file with a new name and copy in the code (or rename the file, and the reference to Mileage in the markup and code behind.)

2.Something is wrong with your model so it doesn't compile. Try commenting out the failing code in this ASPX page, cose all open files, and press Ctrl+Shift+B to rebuild all code. Do you still get errors?

Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
leeWozyWarren (January 24th, 2012)