Q:

How to make Html.ValidationMessageFor() render a DIV instead of a SPAN?

I am using ASP.NET MVC 5 and I have a form that uses the following Html helper
   @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger" })

When I look at the rendered Html that is produced in the browser it seems to render this as a Span element. This causes the validation message to be on the same line as one of my Labels.
What I want to know is how to make the @Html.ValidationMessageFor() method render a  Div element instead of a Span?

A:

Instead of turning it into a div just add a style rule do the ValidationMessageFor:
 @Html.ValidationMessageFor(model => model.Name, "", new { @class = "text-danger newLine" })

.newLine 
{
    display:block;
}

