使用标准主题,我的页面是“C”,但不是白色下拉列表,我想从主题“B”获得蓝色下拉列表。有没有办法在使用DropdownListFor
快捷方式时设置数据主题?
即。类似的东西:
@Html.DropDownListFor(m => m.SomeId, new SelectList(Model.SomeList, "Id", "Name"),
new { id = "SomeSelectedId", name = "xxx", onchange = "this.form.submit();", **DATA-THEME="B"** })
尝试了许多不成功的事情,有什么建议吗?
答案 0 :(得分:0)
您必须切换到RouteValueDictionary:
@Html.DropDownListFor(m => m.SomeId, new SelectList(Model.SomeList, "Id", "Name"),
new RouteValueDictionary(new { id = "SomeSelectedId", name = "xxx", onchange = "this.form.submit();"})
{{"data-theme", "B"}})