Using Episerver CMS 9 is there a way to only perform validation of a page when publishing and not on autosave?
We wish to let the editors leave the content in a invalid state when it's work in progress.
Implementing validation as suggested by the documentation using (IValidate) leads to validation to occur on autosave.
Implementing a (MVC) ValidationAttribute and decorating my properties with also seems to be validated during autosave.
What's the solution?
Hoping for something other than this =)
You could add a validation on the publishing event. This will trigger before the pages is actually published.
Here is an example.
Thanks for the suggestion Niklas, I might have to do it that way I guess.
But I would prefer a solution where I get to keep the validation rules as attributes together with my models (pages etc) without them being processed on the save event.
It would be nice if Episerver could let us specify the events for when to validate an instance of a contenttype.
[ValidateOn(ContentEvents.PublishingContent)]public class StandardPage : PageData