When is dynamic properties loaded into CurrentPage?

Member since: 2005
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
  • Member since: 2005


    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

    #29313 Apr 20, 2009 16:47
  • Member since: 2004
    Try CurrentPage.PopulateDynamicProperties();
    #29314 Apr 20, 2009 16:49
  • Member since: 2005

    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

    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.
Please login to post a reply