如何在mvc @ Html.ValidationSummary中获取新行

时间:2014-07-03 16:33:41

标签: asp.net-mvc

如何在mvc ValidationSummary

中获取新行
@Html.ValidationSummary(true, "asdfsadfsdf <br> sdfsdsddsfdfsdsf")


I want a new line instead of <br> in the output message

1 个答案:

答案 0 :(得分:3)

@if (!ViewData.ModelState.IsValid) {
   <div>
      @Html.Raw(HttpUtility.HtmlDecode(Html.ValidationSummary(true, "asdfsadfsdf <br> sdfsdsddsfdfsdsf").ToHtmlString()))
   </div>
}