Try our conversational search powered by Generative AI!

Get parsed HTML from Xhtml-String-property


On some pages I would like to be able to (in OnLoad) to get the parsed HTML from a XhtmlString-property defined on the page and replace some of the text (acutally adding popups with descriptions for specific words) before displaying it.

If the Xhtml-string property contains neither DynamicContent or Blocks, this works fine. However, both blocks and DynamicContent makes this difficult.

I have read this blogpost from Ted Nyberg, but it don't  help me with blocks.

Mar 16, 2016 15:28

Hi! Take a look at this blog post and the ToBlocksIncludedString method. It might contain what you are looking for

Edited, Mar 16, 2016 15:43

Thanks! But I'm not quite sure how to get the rendered HTML for the individual blocks on line 17 in your ToBlocksIncludedString()?

The markup for the blocks are defined in separate usercontrols (still stuck on webforms). How can I get the rendered html without duplicating all the markup in the extension method?

Mar 16, 2016 16:35
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.