Try our conversational search powered by Generative AI!

When in the control lifecycle does dynamic content execute?


At what point in the Property control lifecycle does Dynamic Content do its thing?  If I override the Property control and do some string manipulation before calling Render, do I have to be concerned with anything?  So long as I don't alter the SPAN tag that represents the dynamic content, will it execute just fine?

Aug 19, 2010 15:19


Maybe Paul or someone who knows it even better than I can answer more in depth, but the dynamic content rendering in triggered from CreateDefaultControls, which is executed from CreateChildControls.

I don't think there should be any problems as long as you leave the SPAN tag alone. We split the xhtml content into fragments when rendering, and the SPAN tag will be the Dynamic Content fragment. So don't mess with it, and I can't see any problem.


Per Gunsarfs
EPiServer Development Team

Aug 19, 2010 16:13

I've extended the property control to have child controls, like this:

<Deane:SuperFantasticProperty PropertyName="PageName" runat="server">
   <Deane:SomeChildControl foo="bar"/>

The child controls are parse via a "ParseChildren" attribute.  This apparently overrides the CreateChildControls method, and dynamic content no longer executes.

Any idea how I can have my cake and eat it too?

Aug 20, 2010 1:56

Well, I'm guessing a bit here, but I think you need to make sure that the CreateCreateDefaultControls, CreateOnPageEditControls and CreateEditControls are called in the correct situations. It's those methods on the property controls that renders our properties in the "correct" way. We do that in the CreateChildControls of the PropertyDataControl.

If you want to handle the xhtml string yourself you need to use the PropertyXhtmlString.StringFragments property to get the rendering of things like dynamic content and permanent links right.

Hmm, not sure if I'm helping or confusing you...


Per Gunsarfs

Aug 20, 2010 11:13


I've narrowed it does to the Render method.  The base method (on the Property) control executes dynamic content.  My override does not.

protected override void Render(HtmlTextWriter writer)
            //This executes dynamic content

            //This does not execute dynamic content (assume "Text" is a string which contains the dynamic content SPAN)
Aug 22, 2010 3:37

I got it.  I needed to call these two methods from within my Render override.

Man, I can't tell you how valuable it is that your code is not obfuscated...
Aug 22, 2010 3:43
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* 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.