2

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.

Thanks

2 Answers 2

1

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

span[role="alert"]
{
     font-weight:bold;
}

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

0

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

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

Your Answer

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

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