如何使用此重载添加htmlAttributes:
我正在使用下面的重载:
@Html.DropDownListFor(model => item.Type.Value, new SelectList(ViewBag.DropDownLoadRecoveryType, "Value", "Text", item.Type))我喜欢将htmlattributes添加到上面的重载中,除非我遗漏了什么东西,否则我不会看到任何重载支持。
new { @class = "form-control" })发布于 2015-03-04 17:26:45
DropDownListFor<TModel, TProperty>(HtmlHelper<TModel>, Expression<Func<TModel, TProperty>>, IEnumerable<SelectListItem>, Object)
@Html.DropDownListFor(model => item.Type.Value,
new SelectList(ViewBag.DropDownLoadRecoveryType, "Value", "Text", item.Type),
new { @class = "form-control" })https://stackoverflow.com/questions/28860867
复制相似问题