Alex Rivera | Logout

How to set the width of the text box when using Html.TextBoxFor

Asked 2010-03-25T16:31:20.180
39

I have the following line in my view:

<div class="editor-field">
     <%= Html.TextBoxFor(m => m.Description)%>                    
</div>

How do I define the width of the text box?

Edit
Report

1 Answer

66

This worked for me for the one-offs, pretty verbose though:

<%: Html.TextBoxFor(m => m.Description, new { style="width:50px;" })%>
answered 2010-07-18T06:55:02.517

Your Answer