I am really struggling with Html.DropdownList. Identical code worked under VS2012 but fails with the subject error under VS2013. Any help would be deeply appreciated.
Controller (selectedCredit is int):
var creditQuery = from d in db.CreditStatus
orderby d.CreditId
select new { d.CreditId, d.Reason };
ViewBag.Credit = new SelectList(creditQuery.ToList(), "CreditId", "Reason", selectedCredit);
View:
@Html.DropDownList("Credit", null, new { @class = "form-control" })
If the second parm of Html.DropdownList is not null, it will ignore selectedCredit and no item will be selected.
List list shows correctly but fails on Post with the subject error. HELP!