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

Try our conversational search powered by Generative AI!

Change content in On_Load of local block

Vote:
 

In Page_Load of an EPiServer page, I am replacing some [[content]] with some data from a database using this code:

if (!PageEditing.PageIsInEditMode)
{
if (property.InnerProperty != null)
{
var prop = property.InnerProperty.CreateWritableClone();
string webFieldContent = contentData.GetWebFieldContent(propertyName);
prop.Value = webFieldContent;

property.InnerProperty = prop;
}
}

This works fine on the page itself, but not on local blocks. When debugging, i can see the data replacement being done as expected, but hwen the page has loaded, the [[content]] has not been replaced after all. Does anyone have an idea why this happens - or even better - what I can do to make it work?

 

#74053
Aug 20, 2013 7:52
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.