Hi I'm fairly new to MVC3 and I'm trying to do something that I think must be fairly common, but can't quite get it.
I have a model I wish store the value for enum DayOfWeek in:
public class Booking
{
public int ID { get; set; }
public int Day { get; set; }
....
}
I've made it an int to store in the database.
I want to edit in the View as a DropDownList:
<div class="editor-field">
@Html.DropDownListFor(model => model.Booking.Day, new SelectList(Enum.GetValues(typeof(DayOfWeek))))
@Html.ValidationMessageFor(model => model.Booking.Day)
</div>
However I get the error: "The field day must be a number".
I know I'm missing something, and probably something simple, can anyone help?