SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to evaluate certain properties of a page whenever it's being saved/published as part of a custom validation I need to implement.

I notice properties has both Cancel and ErrorMessage properties but as you can guess these aren't really appropriate for validation and showing a message to the user while they can still see the page.

Using an event receiver is preferable but I'm open to other server-side options.

share|improve this question

The problem is that the user will get really unhappy if they spent ages entering content which then disappears if they made a mistake on another field. What is the validation you are doing that means you have to leave the page rather than use normal in page validation?

share|improve this answer
But I can still call the base ItemUpdating method by all means and use the beforeProperties/afterProperties to only save the relevant fields. In answer to your question - I need to conditionally mandate certain fields. So, for example, depending on the value of one property - another may be required, may not. Thanks a lot for your reply. – JᴀʏMᴇᴇ Jul 16 '12 at 14:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.