views:

101

answers:

1

I have small design question about

html.DropDownListFor() 

How can i change width of html.DropDownListFor() ?? For example by css.

Thanks for answers

+2  A: 

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

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

EDIT

<style>
    .MakeWide { width: 200px; }
</style>

<%= Html.DropDownListFor(x => x.Name, new SelectList(new List<string>()), new { @class = "MakeWide" })%>
griegs
These codes aren't working
Peter M.
@Peter M, see my edit. I have tested this and it works. If it doesn't work on yours then we have another type of problem. Possibly another style is setting the width of all <select input boxes.
griegs
thanks .. now it is working :)
Peter M.