Trying to do a simple drop down with static options
I have tried multiple ways of doing this, but none of them will render.
Not sure what I got wrong. Any help appreciated.
@Html.DropDownListFor(m => m.NoteType, new List<SelectListItem> { new SelectListItem { Value = "Operations", Text = "Operations" }, new SelectListItem { Value = "Management", Text = "Management" } }, new { @class = "form-control chosen-select" }) @Html.DropDownListFor(m => m.NoteType, new List<SelectListItem> {new SelectListItem() {Text = "Operations", Value = "Operations"}, new SelectListItem() {Text = "Management", Value = "Management"}}, new { @class = "form-control chosen-select" }) @Html.DropDownListFor(m => m.NoteType, new SelectList(new List<Object>{new { value = "Operations", text = "Operations" }, new { value = "Management", text = "Management" },},"value","text",2), new { @class = "form-control chosen-select" }) @Html.DropDownListFor(m => m.NoteType, new SelectList(new List<Object>{ new { value = "Operations" , text = "Operations" }, new { value = "Management", text = "Management" }, "value", "text", 2),"- Please select a Notes type -", new { @class = "form-control chosen-select" })
0 comments:
Post a Comment