问:如何设置 @Html.DropDownList 的宽度(而不是在 css 中)?
@Html.DropDownList("ListId", String.Empty, new {style="width: 250px;"}) @* no go!*@
最佳答案
您应该使用 View 模型方法。然而,懒惰的出路就是给第二个参数一个空值。
@Html.DropDownList("ListId", null, new {style="width: 250px;"})
关于asp.net-mvc-3 - @Html.DropDownList 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7615321/