2016-10-25 110 views

回答

2

看一看at the docs(或智能感知),你会看到可用重载 尝试

@Html.TextBox("Imie", null, new { @class = "boxx" }) 
1

你可以尝试下面的代码:

@Html.TextBox("Imie", null, new { @class = "boxx" }) 

第3个值为HTML属性。

希望它解决了您的问题。

感谢

1

,你也可以尝试内联CSS,如果你想

@Html.TextBox(x => x.testBox, new { style = "width: 20px;" })