C# 枚举转换selectlistitem 及 MVC @Html.DropDownListFor() 调用详细
2021-03-19 02:26
标签:res play show bool des data @class obj The 枚举转换方法 Controller: C# 枚举转换selectlistitem 及 MVC @Html.DropDownListFor() 调用详细 标签:res play show bool des data @class obj The 原文地址:https://www.cnblogs.com/DataBase-123/p/11044937.html
///
var selectLists = EnumExtension.GetEnumDataSource(typeof(UserType), false, (int)result.Item.RoleId);
TempData["RoleSalesList"] = selectLists;
@Html.DropDownListFor(model => model.RoleId , TempData["RoleSalesList"] as IEnumerable, new { @class = "form-control" } )
文章标题:C# 枚举转换selectlistitem 及 MVC @Html.DropDownListFor() 调用详细
文章链接:http://soscw.com/essay/66050.html