When is dynamic properties loaded into CurrentPage?

Vote:
 
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?
#29312
Apr 20, 2009 16:36
Vote:
 

Hi

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.

Regards

Per Gunsarfs
EPiServer CMS Development Team

#29313
Apr 20, 2009 16:47
Vote:
 
Try CurrentPage.PopulateDynamicProperties();
#29314
Apr 20, 2009 16:49
Vote:
 

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.

#29316
Apr 20, 2009 18:34
Vote:
 

bump up

#41668
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.