title: HTML encode decode c# MVC4
body: <p>I am in a process of upgrading a c# MVC2 project into c# MVC4.</p>
  
  <p><strong>Here is the scenario in MVC2</strong></p>
  
  <p>Input string(from database)</p>
  
  <pre><code>   Model.text="&lt;p&gt;Hi&lt;br&gt;hello!&lt;br&gt;you there&lt;/p&gt;"
  </code></pre>
  
  <p>Output (rendered in the view)
   rendered using</p>
  
  <pre><code> &lt;%=Model.text %&gt;
  
  Hi
  hello!
  you there
  </code></pre>
  
  <p><strong>Here is the scenario in MVC4</strong></p>
  
  <p>Input string(from database)</p>
  
  <pre><code>   Model.text="&lt;p&gt;Hi&lt;br&gt;hello!&lt;br&gt;you there&lt;/p&gt;"
  </code></pre>
  
  <p>Output (rendered in the view)
   rendered using</p>
  
  <pre><code>@Model.text
  
  &lt;p&gt;Hi&lt;br&gt;hello!&lt;br&gt;you there&lt;/p&gt;
  </code></pre>
  
  <p>I tried </p>
  
  <pre><code>@HttpUtility.HtmlDecode(Model.text) 
  @HttpUtility.HtmlEncode(Model.text) 
  </code></pre>
  
  <p>Nothing helps... </p>
  
  <p>I had a similar problem in MVC4 <a href="https://stackoverflow.com/questions/8956992/ajax-pager-not-working-in-mvc4">asked here</a> (the ajax result is rendered with html tags not the actual html)</p>
  
  <p>Is some of my settings troubling me??? or is that something to do with HTML 5 or am I missing anything in using MVC4.
  Please help!!</p>