2013-04-18 27 views

回答

45

嘗試此

@Html.TextBox("ticket_new_attachment_attributes_0_description", null, new { @class= "bigfield"}) 
+0

這是GR8,其工作。謝謝 –

+2

這段代碼確實有用,但請注意,馬里奧Sannum給出了一個理由,爲什麼在他的答案下面。第二個參數是值,第三個參數是屬性。 –

4

的第二個參數是value
您需要使用過載與第三參數的HTML屬性,像這樣:

// Pass null (or the value) as second parameter 
@Html.TextBox("ticket_new_attachment_attributes_0_description", null, new { @class = "bigfield"}) 

msdn reference

2

對於@ Html.TextBox第二個參數是文本框的值 是這樣,你可以通過「」作爲文本框的值和第三個參數是HTML屬性

嘗試下面的html:

@Html.TextBox("ticket_new_attachment_attributes_0_description", "", new { @class= "bigfield"}) 
+0

3年前提問這個問題...目前有最佳答案。 – rakaz

相關問題