【发布时间】:2015-04-17 03:23:41
【问题描述】:
我的模型中有以下数据注释
[StringLength(6, ErrorMessage = "MyMsg")]
public string MyField { get; set; }
但在我看来,我收到错误“NaN”
该字段仅接受 0 作为值。
为什么?
[剃刀]
@Html.TextBoxFor(model => model.MyField)
@Html.ValidationMessageFor(model => model.MyField)
【问题讨论】:
-
显示 Razor 部分。
-
我编辑了原帖。 @尤达
-
您显示的代码与该错误无关。
标签: c# asp.net-mvc