Reputation: 809
I've several ways of doing it like this, to no avail:
<div class="editor-field">
@Html.DropDownListFor("ManufacturerId", String.Empty, new { style="width:500px" })
@Html.ValidationMessageFor(model => model.ManufacturerId)
</div>
Thanks for any tips!
Upvotes: 3
Views: 8022
Reputation: 156524
The general gist of what you're doing should work, but it looks like your arguments may be a little confused. How about:
@Html.DropDownList("ManufacturerId", Enumerable.Empty<SelectListItem>(),
new{ style="width: 500px;"})
Upvotes: 2
Reputation: 9377
@Html.DropDownList("ManufacturerId", Enumerable.Empty<SelectListItem>(),
new { @style = "width: 500px;" })
Upvotes: 3