Display encoded html with razor

asp.net-mvc-3, html-encode, razor

Solution

Try this:

<div class='content'>    
   @Html.Raw(HttpUtility.HtmlDecode(Model.Content))
</div>

Problem

I store encoded HTML in the database. The only way i could display it correctly is : ``` <div class='content'> @MvcHtmlString.Create(HttpUtility.HtmlDecode(Model.Content)); </div> ``` It's ugly. Is there any better way to do this?

Original source