Peter M. Peter M. - 1 year ago 152
ASP.NET (C#) Question

How to change width of html.DropDownListFor()

I have small design question about


How can I change width of
For example by css.

Thanks for answers

Answer Source

Have you tried Html.DropDownListFor( new {width:"100"})

or Html.DropDownListFor( new {@class:"longDropdownList"})


    .MakeWide { width: 200px; }

<%= Html.DropDownListFor(x => x.Name, new SelectList(new List<string>()), new { @class = "MakeWide" })%>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download