I'm trying to show page errors so I have written the following code:
<div class="errors">
@{
ViewData.ModelState.Values.SelectMany(v => v.Errors).ToList()
.ForEach(e => { Html.Raw($"<span>{e.ErrorMessage}</span>"); });
}
</div>
The Html.Raw()
does not output anything.
Razor - HTML.RAW does not output text suggest writing it like @Html.Raw
which in my case is not valid