I am trying to populate a drop down list using an enum with MVC4. I have the following enum with a Display
attribute:
public enum PlatformEnum
{
[Display(Name = "--- Please Select ---")]
Undefined = 0,
[Display(Name = "Android")]
Android = 1,
[Display(Name = "iOS")]
iOS = 2
}
In my view I have the following drop down list:
@Html.DropDownListFor(model => model.Platform, Model.DropDownPlatform)
However, the display values in the drop down list are:
Undefined
Android
iOS
I need Undefined
to display as --- Please Select ---
. Is this possible using display attributes?