Now we are going to redirect the above error message to our custom error page. In Custom List we are going to add an event & handle the an Item Deleted event.
First Create a SharePoint 2010 Event Receiver project.
Now we have asked to select project deployment options either Sandbox or Farm. I am going to deploy this project as Farm Solution .
Now Choose the Type of Event Receiver and Item source. In our case Source is Custom List and Type of Event Receiver is List Items.
Once you selected above settings click finish. VS.NET 2010 will create Event Handlers for the events you selected in the above list.
Now add Application page item to the project.
Design your custom Error page using HTML as shown below.
Now add the event handler code for ItemDeleteing as Shown below.
}
}
}
Now Build ,deploy & test the solution (Hit F5). Now go to any Custom list and try to delete an item.
now you will get this Custom Error message.
Comments