Hi All,
I am trying to update SharePoint 2010 event receiver code for a list. The problem is the old way to redirect the user to a custom error page is now obsolete and no longer works. I have tried to find example of SharePoint 2013 code that does the exact thing without any luck. The old obsolete SharePoint 2010 code is shown below
///<summary>
/// A list is being deleted.
///</summary>
publicoverridevoid ListDeleting(SPListEventProperties properties)
{
var web = properties.WebUrl;
// properties.ErrorMessage = "Custom Error Message";
properties.Status =SPEventReceiverStatus.CancelWithRedirectUrl;
properties.RedirectUrl = web +"/_layouts/Seal/CustomErrorPage.aspx";
}
}
}
Does anyone have SharePoint 2013 code that does the same thing or something similar or a link to a web site that demonstrates how to do it for a SharePoint 2013 site?
I hope you can helpColin