ViewBag名称是否与DropDownList中的Model属性名称相同?
SelectList
:
ViewBag.CustomerID = new SelectList(db.CustomerSyncs, "CustomerID", "Name");
DropDownListFor
View
:
@Html.DropDownListFor(model => model.CustomerID, (SelectList)ViewBag.CustomerID, "please select")
ViewBag
Model
CustomerID
繁华开满天机
至尊宝的传说