Try our conversational search powered by Generative AI!

Reading DynamicContent in code behind


I have a page type based on the Long String > 255, that has a DynamicContent property to display a site wide value on the web page. The value is displayed when the following is used on the ASPX page

<EPiServer:Property ID="propIntro" PropertyName="MainIntro" runat="server" />    

Is there a way of getting the value of the DynamicContent property in the code behind, as we use the first 100 characters of this field as the teaser text on the listing (branch) page. I can get the value with

PropertyData intro = page.CurrentPage.Property["MainIntro"];
if (intro != null && !intro.IsNull)
   ltlIntro.Text = intro.ToWebString();


Nov 15, 2010 18:32

Ted Nyberg posted about parsing dynamic content from code, rather than from a property.  This might be what you're looking for:

Nov 15, 2010 18:42

I just posted this, related to this discussion:

Simple Token Replacement

Based on what you're doing, this might be a good fit.

Nov 15, 2010 20:27
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.