I have created a sharepoint item updating event receiver for a custom list. The event receiver checks certain condition and block the user from saving the item if the condition fails. TO display the warning, i have used

 properties.Status = SPEventReceiverStatus.CancelWithError;
    properties.errormessage= "error"; 

Now it shows error message below the form in red font. I want to change the formatting of the text, and want to show the error message in bold characters. How can this be achieved, any help on this will be appreciated.


2 Answers 2


if you inspect the html, you will find something that might help


you can apply this css locally (CEWP) or globally (master page/alternatecssurl reference)


Use this one instead

properties.ErrorMessage = "Error";
properties.Cancel = true;
properties.Status = SPEventReceiverStatus.CanceWithRedirectUrl;
properties.RedirectUrl = "your custom error page"

You can find more information here

  • I do not want to redirect on to the different page, instead I want to show on the same edit form
    – Muskan
    Oct 25, 2017 at 7:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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