2012-04-10 49 views

回答

28
@Html.TextBox("redeemamt", @Model.Amount, new {style = "width: 100px;"}) 

或者你可以尝试这个:

@Html.TextBox("redeemamt", @Model.Amount, new { size = "100" }) 
+0

我试着大小=“”,但不起作用。 – Reinard 2012-04-10 09:06:35

+0

@ Html.TextBox(“redeemamt”,@ Model.Amount,new {style =“width:100px;”})肯定会起作用 – 2012-04-10 09:11:26

+0

我认为他绝对不需要任何css样式。但是,正如我在答复中所述,这可能是唯一可行的。 – 2012-04-10 09:13:50

4

听起来你正在寻找Html.TextArea:

@Html.TextArea((string)name, (string)value, (int)rows, (int)columns, (object)htmlAttributes)

0

如果您已经添加自举则你可以检查输入属性并修改

e.g改变高度

input[type="text"] 
height: 25px; 
line-height: 25px;