Why is ValidationSummary(true) displaying an empty summary for property errors?

前端 未结 11 1140
傲寒
傲寒 2020-12-13 13:51

I am having a slight issue with the use of ValidationSummary(true) to display model level errors. If the ModelState does not contain model errors (i.e. M

11条回答
  •  孤街浪徒
    2020-12-13 14:20

    ValidationSummary accepts an optional message parameter. If you set this parameter, then the box doesn't look as silly.

    @Html.ValidationSummary(true, "Sorry, that didn't work. Please check the details submitted and try again.")
    

提交回复
热议问题