0

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>
  • Write a Visual Web Part if you want code behind and drop it on your ErrorHandling page. – Arsalan Adam Khatri Jun 6 '16 at 16:25
0

You first need to finalize that which kind of page do you need like Application Page or Site Page?

Using the most basic definition, a site page is customizable by an end user while an application page is not. That means that a user can pop open SharePoint Designer 2010 and make changes to a site page, but they cannot do this with an application page. So, what do we mean by “customizable”? When we open SharePoint Designer 2010 and make changes to a site page, those changes are stored in the database. The next time we request the page, the page is loaded from the database. There are more differences than this, but the key difference is really the ability to customize a page.

You can get more details from below link.

Creating a SharePoint Site Page With Code-Behind Using Visual Studio 2010

  • Are you able to create page from code behind? Is above given answer helps you? – Hardik Jun 7 '16 at 11:50
  • Thanks for your answer, I will investigate on that and return as soon as possible to give you a answer. Is the process the same for VS2015 and Sharepoint 2013 ? – GwenGuts Jun 7 '16 at 15:22
  • Yes there will be same process. – Hardik Jun 7 '16 at 15:27
  • I tried it for SP2013 & VS2013. It worked fine for me. – Hardik Jun 7 '16 at 15:28
  • So, I followed the tutorial but, when I deploy, I encounter an error: "Error occurred in deployment step 'Add Solution': Error: Cannot find this file specified in the manifest file: SP2013_ErrorPage.dll". That is logic I think because the file doesn't exist yet in the GAC – GwenGuts Jun 27 '16 at 13:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.