You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
You have an enum named the same as a class. Now, you have the enum nested inside the class which should technically work, however, it isn't good form to have things named the same. Many people add a suffixes to enums to make their types more descriptive and indicative of them being an enum. I often use "Type", such as "DirectionType". This should eliminate the error.
In addition to Peter's reply, the idea of Direction.cs is to contain just the Enum. There's not need for the wrapping class. The following in that file should be enough:
Code:
public enum Direction
{
Horizontal = 0,
Vertical = 1
}