ASP.NET MVC How to add line break -


this question has answer here:

i got following code in asp.net mvc view.

<div class="row">   <div class="col-sm-12">     <span id="errorid" class="glyphicon glyphicon-remove" style="color: #ff0004;"></span> @model.errormessage    </div> </div> 

the @model.errormessage may contain contain multiple strings when view rendered, don't see line break. tried adding <br /> , \r\n rendered on 1 line.

here sample of returning error message:

the first field required.\r\nthe second field required.\r\nthe third field required.\r\n

i replaced \r\n <br> line tag still not work.

how can break string separate lines? thanks.

you can wrap @model.errormessage in <pre> </pre> tags


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -