@Html.EditorFor(model => model.mobileNum, new { @class = "mpn" })想給這句話加上自定義的class,但是怎么也顯示不出 始終顯示這樣的效果:<input class="text-box single-line" data-val="true" data-val-length="手機(jī)號不多于20字符" data-val-length-max="20" data-val-remote="用戶賬號已存在" data-val-remote-additionalfields="*.mobileNum" data-val-remote-url="/Test/CheckMobileExists" id="mobileNum" name="mobileNum" type="text" value="" />如何加上自定義的樣式,請高手指教!
2 回答

慕蓋茨4494581
TA貢獻(xiàn)1850條經(jīng)驗 獲得超11個贊
@Html.EditorFor(model => model.mobileNum, new { @class = "mpn" })
goes to
@Html.TextBoxFor(model => model.mobileNum, new { @class = "mpn" })
Because the default template for EditorFor does not support custom attribution.

搖曳的薔薇
TA貢獻(xiàn)1793條經(jīng)驗 獲得超6個贊
首先支持1樓,另外@Html.TextBoxFor(model => model.mobileNum, new { @class = "mpn test" })
test可以是其他的樣式文件名,與前面的樣式名隔開。
- 2 回答
- 0 關(guān)注
- 525 瀏覽
添加回答
舉報
0/150
提交
取消