1

使用标准主题,我的页面是“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"** })

试了很多次都不成功,有什么建议吗?

4

1 回答 1

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"}})
于 2013-01-31T00:26:22.553 回答