How do you control the width of the autocomplete textbox?

Jan 13, 2011 at 9:55 AM
Edited Jan 13, 2011 at 9:56 AM

I know this is a "dumb" question, but when I use AutocompleteFor I cannot find a way to control the width of the textbox. None of the built in parameters seems to do it.

Coordinator
Jan 13, 2011 at 1:17 PM
Edited Jan 13, 2011 at 1:29 PM

there are lots of ways doing this with css,

you could also write inline css style like this:

        <%=Html.AutocompleteFor(o => o.Person, htmlAttributes:new{style="color:purple; width:300px;"}) %>

 

http://www.w3schools.com/css/

Jan 13, 2011 at 2:34 PM

Thank you.

I know css, it was the htmlAttributes:new that I could not figure.

Anyway that is the correct answer.