mvc 3 Html.EditorFor add html attribute not work

Viewed 59070

I try add html attribute for EditorFor

 @Html.EditorFor(model => model.UserName, new { style = "width: 100px" })

But any way I get

<input id="UserName" class="text-box single-line" type="text" value="" name="UserName">
7 Answers
Related