I display some text in the view:
....
<%: model.Content %>
....
my model.Content contains html tags, and I want to display them not as text, but as html. How to do it?
Thanks.
Use:
<%: MvcHtmlString.Create(model.Content) %>
or
<%= model.Content %>
Because <%: does Html encoding, while <%= doesn't.
MvcHtmlString.Create creates a 'save' Html string, which<%: takes and prints out as is.