I have many event receivers and, on error, I want to redirect to a custom page that will manage those errors.
I know that I can create a custom page per Event Receiver with the creation of Mapped Folder in Visual Studio, but, I want a single page that'll deal with any of my ER.
In addition of that, this page must have a code-behind because I want to manage the error sent by the ER (via a redirection), using the Response.Querystring property of the page.
Is there any way to create a custom aspx page with code behind at the root of the site collection ?
Thanks for your answer.
Edit (2016-06-27): I followed the tutorial indicated below, but I have an error when I deploy my solution: Error occurred in deployment step 'Add Solution': Error: Cannot find this file specified in the manifest file: SP2013_ErrorPage.dll
I adapted the Package.Template.xml like that for my solution:
<?xml version="1.0" encoding="utf-8"?>
<Solution xmlns="http://schemas.microsoft.com/sharepoint/">
<Assemblies>
<Assembly Location="SP2013_ErrorPage.dll"
DeploymentTarget="GlobalAssemblyCache">
<SafeControls>
<SafeControl Assembly="$SharePoint.Project.AssemblyFullName$"
Namespace="SP2013_ErrorPage"
TypeName="ErrorPageTemplate"
Safe="True"/>
</SafeControls>
</Assembly>
</Assemblies>
</Solution>