Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Dynamic Content wont render


Hi. I´m trying to get my first Dynamic Content to work. The problem is it wont render, the yellow box is still there after saving and publishing.

When I debug it seems like the GetControl method never gets called and the State property get/set-methods gets called several times.

Can anyone point me in the right direction?

DynamicHeadline.cs (The dynamic content class)

DynamicHeadlineSettings.ascx.cs (The settings set in edit mode)


Thank you!

Dec 01, 2008 14:51


what do

public string Text { get; set; }

public string Template { get; set; }


Edited, Dec 01, 2008 17:10

Hi again

I guess that you dont update the value of the dynamic content class based on what Text and Template is. Therfore when you save you save the empy Value and not the combined value of Text and Template.

Dec 01, 2008 17:15
Dec 01, 2008 21:47
Dec 01, 2008 22:23

Did you figure out what the problem was?

I'm stuck in the same situation, the dynamicproperty renders with control in my develompment enviroment, but as soon as i move it to test it stops.. It runs the constructor and state over and over again, and once in a while it checks the rendering method.. but it never runs the GetControl method. 


I figured out what the problem was (in my case). 

I had a custom rendering of propertylongstring's.. and that screwed up the rendering of the dynamic content.. Once this was disabled it all worked like a charm. 

I used steves howto ( ) and registered the new propertydatacontroladapter in adaptermappings.browser (instead of global.asax.cs). 

Is there any nifty way of checking wether or not a  property contains dynamic content?

Edited, Feb 18, 2009 14:04

yes :),

if its extends PropertyXhtmlString and one of the items in StringFragments is DynamicContentFragment then it contains a dynamic content control

check out


Feb 18, 2009 23:25
Great, thanks:)
Feb 19, 2009 8:17

I still want to override the rendering of propertystrings, and this is how i solved it.

Instead of creating a new panel that stores all the controls for the property i just add my controls directly into the parents controlcollection, and thus getting rid of the initial div for each property. 

Here's the code from my implementation of the propertycontroladapter.

public override void CreateDefaultControls()

ControlCollection target = base.Control.Controls;
PropertyXhtmlString propertyData = base.PropertyData as PropertyXhtmlString;
if (propertyData != null)
foreach (IStringFragment fragment in propertyData.StringFragments)
Literal child = new Literal();
child.Text = this.ToWebString();




Feb 19, 2009 10:27


I also have this problem. My dynamic content won't render, it only displays that yellow box. The constructor and state is run several times, but GetControl is never called. RendersWithControl returns true.

I tested the DynamicPageProperty that is included in the basic episerver site, and that one also just renders that yellow box. So I get the feeling my site is missing something basic to enable rendering of dynamic content....

I do not override rendering of propertystrings so the solution Espen Limi gave doesn't do anything for me.

Anyone know what might be wrong?

May 04, 2009 8:37

Could it be that you display the property like <%=CurrentPage.Property["MainBody"]%>

 sorry, had to ask :)

May 04, 2009 10:06

<EPiServer:Property PropertyName="MainContent" runat="server" />


May 04, 2009 10:32
and the MainContent is of propertyxhtmlstring?
May 04, 2009 12:38
Ah no, it was a regular longstring property :) While the dynamic content is available there too, I didn't even think about it. Thanks!
May 04, 2009 14:52


Nice catch, this is an oversight on our side. The tool shouldn't be avaliable on a property that can't use the result :)

I'll register it as an issue and our triage will take a look at it. Although this could be something that's very hard to fix, due to the way the editor works.


Per Gunsarfs
EPiServer CMS development team

May 05, 2009 10:26

Thanks guys, your suggestions helped me solved my problem.



Edited, Dec 22, 2009 2:20
* 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.