How to bind IEnumerable model to DropDownListFor and DropDownList @model IEnumerable @Html.DropDownListFor();
答案 0 :(得分:0)
View
@Html.DropDownListFor(x => x.doc_typeid, Model.doctype_name, "--Select--", new { @class = "form-control", @style="width:auto;" })
Controller
var docTypes = from c in db.tm_doc_type select c;
doctype_name = new SelectList(docTypes, "doc_typeid", "doctype_name"),