MVC3 - passing NEW-LINE to ModelState.AddModelError

前端 未结 4 1020
闹比i
闹比i 2020-12-19 01:01

When an error occurs on the back-end, the MVC controller returns a message via the
ModelState.AddModelError(\"\", \"message\");

I would like to ha

4条回答
  •  情书的邮戳
    2020-12-19 01:27

    Try wrapping the validation summary in an Html.Raw and a Server.HtmlDecode, like so:

    @Html.Raw(Server.HtmlDecode(Html.ValidationSummary().ToString()))
    

提交回复
热议问题