嗨,大家好,我已经看过谷歌,雅虎,找不到答案,为什么它是我的'@Html.ValidationMessageFor不起作用。'当我运行应用程序时,什么都不会发生,它允许输入所有内容。当我尝试编辑我的编辑视图中的项目时,它也会崩溃。我有以下几点:
@* @Html.LabelFor(model => model.Posted)*@
@Html.HiddenFor(model => model.Posted, Model.Posted = DateTime.Now)
@Html.ValidationMessageFor(model => model.sendinghome)
@Html.LabelFor(model => model.Cartypes)
@Html.EditorFor(model => model.Cartypes)
@Html.ValidationMessageFor(model => model.Cartypes)
@Html.LabelFor(model => model.RegNum)
@Html.EditorFor(model => model.RegNum)
@Html.ValidationMessageFor(model => model.RegNum)
@Html.LabelFor(model => model.Regprice)
@Html.EditorFor(model => model.Image)
@Html.ValidationMessageFor(model => model.Regprice)