One of my error messages displays a link. However, Html.ValidationSummary() encodes it, and therefore it displays the following:
An account already exists with your mobile phone or email. If you forgot your password, please href = "/ account / reset"> reset </ a> it.
Instead, it should look like:
An account already exists with your mobile phone or email. If you have forgotten your password, please reset.
The error is added to the ModelState internal view as follows:
if (...) { ViewData.ModelState.AddModelError(string.Empty, string.Format("An account with the mobile or email you have specified already exists. If you have forgotten your password, please {0} it.", Html.ActionLink("Reset", "Reset"))); }
In short, how should I prevent Html.ValidationSummarry() selectively / fully encoding html in errors.
Varun k
source share