How to display mesages fom sharepoint list event receiver

Hi,

I have a sharepoint webpart page showing the list content on it.

at the background on the list ItemAdded/ItemUpdated I am doing some sort of operations.

Is there is any way to show the error messages/status to the user on the sharepoint page.

I am not able to get the server side messages to the client side(on SharePoint Page).

Please help on this.

May 28th, 2015 9:49am

Hi

 did you try to use

   properties.ErrorMessage = "your message";
           properties.Status = SPEventReceiverStatus.CancelWithError;
           properties.Cancel = true;

http://www.c-sharpcorner.com/UploadFile/3a164c/custom-messages-using-event-receiver-in-sharepoint/

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 9:53am

Hi Rajendra,

Thanks for your inputs,

actually we are trying out this on sharepoint 2007, and on SP 2007 we are not able to get properties.redirectUrl property.

is there any other way for SP 2007 ?

May 29th, 2015 2:53am

Hi

you can set 

properties.ErrorMessage = "Deleting not supported!"
    properties.Cancel = True

in moss 2007 .

https://msdn.microsoft.com/en-us/magazine/cc163318.aspx

Create your custom error page with the general message and redirect using SPUtilty.Redirect

here is the blog for the same.

http://kwizcom.blogspot.in/2011/11/redirect-to-custom-error-page-from.ht

May 29th, 2015 3:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics