I’m trying to setup a basic DropDownListFor in MVC:
@Html.DropDownListFor(modelItem => item.CheckerApproved, new SelectList(new SelectListItem { Text = "True", Value="1" } , new SelectListItem { Text = "False", Value="0"}))
This is in my view and what I’m wanting is a basic dropdown of true and false with values of 1 and 0 respectively.
I’m thinking the part I have wrong is adding the items to the SelectList constructor.
Can somebody help me with this?
Try this: