A blog about interesting stuff that I want to remember, but am too lazy to write down.
Sunday, 12 January 2014
MVC 4: How do I line-wrap my text in an editor?
The solution is to add an annotation to the field in the model class:
Then, to display the item in the view, use Html.Raw.
@Html.Raw("<pre>"+ Html.Encode(@Model.MyField) + "</pre>"
Share to Twitter
Share to Facebook
Share to Pinterest
Post a comment
Post Comments (Atom)