首页 > 代码库 > MVC 枚举 转 SelectListItem

MVC 枚举 转 SelectListItem

  ViewBag.userlevel = new SelectList(Enum.GetNames(typeof(AdminLevels)),"", "", teacher.userlevel);

 

@Html.DropDownList("usertitle", String.Empty)

 

MVC 枚举 转 SelectListItem