Controller中:
ViewBag.modules = new SelectList(集合.ToList(), "下拉框键", "下拉框值");
View中:
@Html.DropDownList("将要返回的值", ViewBag.modules as IEnumerable<SelectListItem>, "--请选择--");
2023-08-16 13:22:58
Controller中:
ViewBag.modules = new SelectList(集合.ToList(), "下拉框键", "下拉框值");
View中:
@Html.DropDownList("将要返回的值", ViewBag.modules as IEnumerable<SelectListItem>, "--请选择--");