@Html.DropDownList
HTML DropDownList
2023-09-11 14:14:40 时间
ViewBag.Producers = new SelectList(db.Producer, "ID", "TypeName");
1 @Html.DropDownList("Producers") // edit 页面 有值 绑定上 默认选中 Producers字段的保存的数据
2 @Html.DropDownList("SpecialAptitude", EnumHelper.GetSelectList3(typeof(SpecialAptitude)), new { @class = "form-control", @onchange = "CheckType(this)" }) // 一个意思
public static IList<SelectListItem> GetSelectList3(Type enumType)
{
IList<SelectListItem> selectList = new List<SelectListItem>();
foreach (object e in Enum.GetValues(enumType))
{
selectList.Add(new SelectListItem { Text = GetEnumDescription(e), Value = ((int)e).ToString() });
}
return selectList;
}
相关文章
- ueditor1.4.3配置过程(包含单独上传文件以及图片的使用),ueditor1.4.3上传配置(转 http://www.bkjia.com/webzh/1001016.html)
- About HTML
- 爬虫新宠requests_html 带你甄别2019虚假大学 #华为云·寻找黑马程序员#
- 使用 BeautifulSoup 进行解析 html
- idea html,js修改不用重启进程
- HTML DOM print() 方法 ,html 打印
- HTML DOM print() 方法 ,html 打印
- centos8平台使用wkhtmltopdf实现html网页转pdf
- HTML里的onfocus事件处理函数
- 如何在TypeScript代码里获得HTML元素的css属性
- ASP.NET Web Pages - HTML 表单
- 在jsp中显示原始html代码,不要渲染 / 在JSP页面中如何将HTML标记显示出来
- 如何把包含图片的docx文件转换为HTML WORD 转为html
- HTML(一)html书写规则、基础元素、功能元素
- 【DOM】了解HTML DOM常用对象: 对常用元素的简化操作_05
- 动态圣诞树-HTML
- 学习HTML这一篇就够了!