I want to make a preset Dropdownlist in asp MVC for a simple email form. I found an example that works great but can't get spaces in the list. I want a space between "GeneralInformation" to "General Information" the example doesn't work for spaces. I'm using dropdownlistfor
I have
public enum feedbackDDL
{
GeneralInformation,
feedback,
QuestionComments
}
I used example http://www.tutorialsteacher.com/mvc/htmlhelper-dropdownlist-dropdownlistfor
Here is my model
public class ContactModel
{
[Required(ErrorMessage = " Required")]
public feedbackDDL ContactDDL { get; set; }
}
public enum feedbackDDL
{
GeneralInformation,
feedback,
QuestionComments
}
here Is my view
@Html.Label("ContactDDL", "Feedback* ")@Html.ValidationMessage("ContactDDL")<br />
@Html.DropDownListFor(m => m.ContactDDL, new SelectList(Enum.GetValues(typeof(myProject.Models.feedbackDDL))), "", new { @class = "ddl2" })