SaaS CMS has officially launched! Learn more now.

When is dynamic properties loaded into CurrentPage?

I want to write an HttpModule that does stuff based on a Dynamic property. So I hook up to the PostRequestHandlerExecute-event and cast the current Handler as PageBase. Works fine. However CurrentPage does not contain any dynamic properties. Why is that?
Apr 20, 2009 16:36


My guess is that it's because the CurrentPage is writeable in that state. It's only when a PageData object is read only that the Property getters will return dynamic properties.

The PageData object never actually contains the dynamic properties, but has a handler that will return the them in the same way as you get "page" properties. But that handler will only be in effect for read only pages.


Per Gunsarfs
EPiServer CMS Development Team

Apr 20, 2009 16:47
Try CurrentPage.PopulateDynamicProperties();
Apr 20, 2009 16:49

Sorry, but I've tried CurrentPage.PopulateDynamicProperties() and it throws an error "The PageData object is read-only."

I could ofcourse use GetPage() but since the module will be run on each page request the pagedata would be loaded twice. I've also thought of DynamicProperty.Load, but since that makes a request to the database I'd like to avoid that also.

Apr 20, 2009 18:34

bump up

Jul 20, 2010 11:13
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.