How do you show carriage returns inside a MVCContrib Grid? I’ve tried replacing the returns with "<br>", however that is actually showing a <br> in my display "test<br>test"
<div id="noteList">
@Html.Grid(Model).Columns(column => {
column.For(x => x.TimeStamp);
column.For(x => x.UserName);
column.For(x => x.Note.Replace("\r\n","\"<br>\"")).Named("Note");
}).Attributes(Style => "text-aligh: center", @Class => "linkGrid")
</div>
Is there a way to get the browser to render the original return’s “\r\n”?
You could use a custom column:
But a safer and IMHO a more robust solution would be to use a custom HTML helper:
and then: