Rendering Rich Content in ASPX Templates

Brendan McKenzie asked on August 4, 2014 09:25

I have a document type that has a rich text field in it with the WYSIWYG (CKEditor) control. I render this field on an ASPX page through an <asp:Literal /> This works fine for most markup, however when a user inserts a YouTube video the following is rendered.


Is there any utility to parse these content strings into valid HTML tags (i.e., a YouTube embed iframe)?

Recent Answers

Richard Sustek answered on September 23, 2014 13:08

Hi Brendan,

I'm guessing that you have added this youtube video trough the widget in CkEditor, is that correct?

I believe that you need to resolve these controls in order to show the correct HTML Markup. You basically need to wrap your literal control in a placeholder like this:

<asp:PlaceHolder runat="server" ID="plcContent">
  <asp:Literal runat="server" ID="ltlContent" EnableViewState="false" />

And then call following method to resolve the controls inside:


There is also an older article which explains this and has some nice examples:

Let us know if this helps and if you need anything else.

Kind regards,

Richard Sustek

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.