Search code examples
asp.net-mvc-3html-encode

mvc3 - How to disable htmlencode of symbols from source


I need to out on my page text from database table. Table field "Text" Contains text with html formatting tags like <p>, <br/> etc... (in table its not encoded!)

When i'm trying to output with @Model.Text i see encoded html tags like &lt;p&gt; How can i disable this html-encode. Thank you.


Solution

  • You can use @Html.Raw(Model.Text) to achieve this.