Hi, I'm not sure if this is the expected behaviour or not... could someone offer me some advice on the following please?
I have an event handler attached to the CopiedPage event. The behaviour appears to be the event is only fired once, regardless of how many pages are actually copied, I assume this is expected behaviour.
What I want to do is extract the value of a property I have defined on the page type. The page type has a default value, which of course an editor may have altered.
In the event handler (where e is the event), I notice that e.Page is not set, so I load using:
PageData page = Global.EPDataFactory.GetPage(e.PageLink);
I then attempt to read the property value, it is called propertyName, using:
PropertyData data = page.Property[propertyName];
This gives me back a valid PropertyDataCollection instance. However data.Value returns null.
The page I am copying does not have a null value, and the default value for the page property is not null.
Can anyone tell me how I can reliably get the value of this property from the page being copied please? At the moment the best I can do is extract the default value from the page type by using the following code:
PageData parentPage = EPiServer.Global.EPDataFactory.GetDefaultPageData(page.PageLink, page.PageTypeID);
I'm using EPiServer 4.60.0.165 running on XP.
e
is the event), I notice thate.Page
is not set, so I load using:PageData page = Global.EPDataFactory.GetPage(e.PageLink);
I then attempt to read the property value, it is calledpropertyName
, using:PropertyData data = page.Property[propertyName];
This gives me back a validPropertyDataCollection
instance. Howeverdata.Value
returns null. The page I am copying does not have a null value, and the default value for the page property is not null. Can anyone tell me how I can reliably get the value of this property from the page being copied please? At the moment the best I can do is extract the default value from the page type by using the following code:PageData parentPage = EPiServer.Global.EPDataFactory.GetDefaultPageData(page.PageLink, page.PageTypeID);
I'm using EPiServer 4.60.0.165 running on XP.