I have a table in my db where one of the properties is an Html page (without the html, head and body tags), and I intend to put it in the middle of one of my views - say, I call a cotroller method that takes an argument, and return a view passing this html big string as the model. I searched for it (not much, I admit), and found the following method:
<%= System.Web.HttpUtility.HtmlDecode(yourEncodedHtmlFromYouDatabase) %>
That was found here in stackoverflow. When I tried a similar razor aproach, I ended up with this:
@System.Web.HttpUtility.HtmlDecode("<h1>Test</h1>")
That's the idea, but it didn't work quite as I planned.
Test
` would actually be encoded something like this: `<:h1>Test<:/h1>`. – Matt Ball Jan 25 '11 at 20:18