Is there a way to display something more then plain text using MVC Validation helper methods? I tried to display somthing like this:
Controller:
string msg = "Error <span style='color:blue;'> bla bla bla</span>";
ModelState.AddModelError("model", msg);
View:
<span ...>@Html.ValidationSummary()</span>
But I get plain text:
"Error <span style='color:blue;'> bla bla bla</span>"
instead of "Error " and blue "bla bla bla":
I tried to pass as msg:
var msg2= MvcHtmlString.Create(msg);
var msg3= new HtmlString(msg);
var msg4= msg3.ToHtmlString();
But it helps nothing.
Interesting, when I use FireBug, and edit UL / LI tag generated by @Html.ValidationSummary() it can display such styles.
Of course - I can change style of validation css: - but it change whole text generated by helper method - which is not what I want.
Any suggestion? Thanks in advance