I'm trying to prevent some records from being deleted from a list. I've got the ItemDeleting event firing and everything works great. I can prevent the item from being deleted just fine. The problem I'm running into is that when I'm logged in as a member of the site [Site Members], I get an Error: Access Denied error message instead of the custom page.
I use the following in my code:
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl; properties.RedirectUrl = "/_layouts/folder/CustomError.aspx";
When I'm logged in as an owner of the site [Site Owners], the redirect works just fine.
What kind of permissions issue am I running into that would prevent members, and possibly visitors, from seeing these custom error messages? I should add that I'm doing all this in Visual Studio 2012 and using SharePoint 2010. The custom error page is an Application Page created in VS 2012.