|Number of votes:||13|
If you wan to be able to archive your goals in a EPiServer project you need to know the product. And EPiServer have (thanks heaven) open dll’s so we can use reflector to browse thru the inner workings of the product. Sometime I guess they regret that decision, but I honestly think that's one of the things that make EPiServer as a product great.
Then back to topic, who can we know our enemy
A twitter user posted a tweet some days ago where he said: “Ohhh, I SOOO want an event to trigger when dynamic properties change. Please! #EPiServer“
But instead of begging he should have tried to know his enemy, an start the all mighty reflector :)
AFAIK there are only one place dynamic properties are saved and that's in the EditDynProp.aspx. And that page have one button, called ApplyButton….
Here we see that there is a method SaveCollection that is called
And that calls a method Save
Which calls PopulatePropertyCommand
And here we see that OnBeforeSavingProperty is called
And here it is. BeforeSavingProperty, that's an event that get called when a dynamic property is saved. Either if it’s empty or have values. This event is only called when you save a dynamic property.
This opens up some nice things that can be done. For instance create a version list on dynamic property page. Which is one of the feature I miss most.
It this event was not there we could also used PageAdaptors to hook our self up to the ApplyButton click event and done it there.
This feature have been around since CMS 5 it seems. So happy coding and use your Reflector when you can :)