【发布时间】:2018-08-20 03:06:03
【问题描述】:
这个我试过了,还是不行
@Html.EditorFor(model => model.discount, new { htmlAttributes = new { @class = "form-control", @type = "number", @step = "0.01", @min = "1", @max = "99999" } })
【问题讨论】:
这个我试过了,还是不行
@Html.EditorFor(model => model.discount, new { htmlAttributes = new { @class = "form-control", @type = "number", @step = "0.01", @min = "1", @max = "99999" } })
【问题讨论】:
@minlength="10",@maximumlength="10" 你可以使用 textboxfor 或 editorfor 什么都行……
【讨论】:
使用maxlength 和TextBoxFor 代替EditorFor
EditorFor 没有允许这样做的重载。
这对你来说可能更有趣: maxlength attribute of a text box from the DataAnnotations StringLength in Asp.Net MVC
【讨论】: