摘要:
按需求设置模型设置方法public IEnumerable<SelectListItem> GetSelectList(int? selectId){var model = from u in db.CaseTypes select new SelectListItem { Selected = (u.CaseTypeId == selectId), Text = u.CaseTyeName, Value = SqlFunctions.StringConvert((double)u.CaseTypeId) };}视图里面调用 @Html.DropDownListFor(model
阅读全文