How to customize the error page in Event Receiver properties.ErrorMessage
-
Thursday, May 17, 2012 12:26 AM
I have an item deleting and I want to redirect my user to a custom page.
or how will I modify the error page? I want to remove the links and the word "Error" and just to show a custom error message.
----------------------- Sharepoint Newbie
All Replies
-
Thursday, May 17, 2012 1:04 AM
This should get you going in the right direction: http://blogs.msdn.com/b/vssharepointtoolsblog/archive/2010/02/15/event-receiver-and-custom-error-page.aspx
-
Thursday, May 17, 2012 11:33 AM
Thanks for this but I already tried that, but it doesnt work for the ItemDeleting, its a known bug of SharePoint.
check my other post:
do you have any other method? The bug occurs only in the Delete in the Context Menu/Dropdown of an item.
However, how will I display my custom page in a modal dialog. because now, I used this
properties.Status = SPEventReceiverStatus.CancelWithRedirectUrl; properties.RedirectUrl = properties.WebUrl + "/_layouts/CustomPage/CustomPage.aspx";
and if I used the Delete button in the ribbon I am redirected to this page (Please note that is shows the left nav and the top nav. I want this to be in a modal dialog popup.
----------------------- Sharepoint Newbie
- Edited by Fix Me Thursday, May 17, 2012 12:05 PM
-
Thursday, May 17, 2012 11:41 AM
Hello!
1. Add ItemAdding event receiver.
Check if title of new item is some code word, for example "!Redirect!" and use redirect code block if so.
2. In ItemDeleting method just cancel without redirect and create new item with title = "!Redirect!".
My contributions: SharePoint 2010 Solution Installer
SharePoint How-To: Create WebPart Page programmatically- Edited by Aviw_ Thursday, May 17, 2012 11:41 AM
- Marked As Answer by Qiao WeiMicrosoft Contingent Staff, Moderator Friday, May 25, 2012 9:32 AM

