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:

[DataType(DataType.MultilineText)]

Then, to display the item in the view, use Html.Raw.

@Html.Raw("<pre>"+ Html.Encode(@Model.MyField) + "</pre>"

Comments

Popular posts from this blog

SharePoint 2013: Error updating managed account credentials

Error deploying Nintex workflow: An item with the same key has already been added