ASP.Net MVC3 using c#
I currently have a database field in my application that stores HTML but when I try to display the HTML field using.
@Html.DisplayFor(model => model.game_description)
Currently the HTML is being displayed as plain text how do I get it to render the HTML properly?
You mean without HTML encoding it? You could use the
Html.Raw
helper:And be warned and fully aware about the consequences of doing this: your site becomes vulnerable to XSS attacks. So make sure you know the origin of this HTML.