Fill Customize Drop down List in MVC
If you are using MVC Model to bind data, but you want to customize fill drop down. Use the below example
===============================
@Html.DropDownListFor(x => x.PV, new List<SelectListItem>
===============================
@Html.DropDownListFor(x => x.PV, new List<SelectListItem>
{
new SelectListItem() {Text = "10", Value="10"},
new SelectListItem() {Text = "20", Value="20"},
}, new { @class = "form-control", })
===============================
Comments
Post a Comment