views:

1876

answers:

1

I have HTML code emitted by FCKEditor stored in a database and would like to display (well render) it onto a view. So, for instance, something stored as:

<>pre<>This is some sample test<>pre</&gt

Will be displayed to the user as:

This is some sample text

(With the appropriate style for preformatted-text)

The view already has the required string to display from ViewData, I'm just not sure what the best way to show it to the user is.

+6  A: 

try

<%= System.Web.HttpUtility.HtmlDecode(yourEncodedHtmlFromYouDatabase) %>

more info here @ MSDN online.

hth!

Pure.Krome