次のコードを使用して css クラスを追加しまし@Html.TextBox
たが、これは に対してのみ機能し、 に対しては機能@Html.TextBoxFor
しません@Html.TextBox
。
@Html.TextBox("ticket_new_attachment_attributes_0_description", new { @class= "bigfield"})
私は何が欠けていますか?
次のコードを使用して css クラスを追加しまし@Html.TextBox
たが、これは に対してのみ機能し、 に対しては機能@Html.TextBoxFor
しません@Html.TextBox
。
@Html.TextBox("ticket_new_attachment_attributes_0_description", new { @class= "bigfield"})
私は何が欠けていますか?
これを試して
@Html.TextBox("ticket_new_attachment_attributes_0_description", null, new { @class= "bigfield"})
2 番目のパラメーターは値です。
次のように、html 属性の 3 番目のパラメーターでオーバーロードを使用する必要があります。
// Pass null (or the value) as second parameter
@Html.TextBox("ticket_new_attachment_attributes_0_description", null, new { @class = "bigfield"})
msdn リファレンスを参照してください。