Hi All,
I'm also having similar problems getting this to work. I want to create a custom Server 500 error page.
In my web config
<error statusCode="500" redirect="~/SitePages/Errors/error500.aspx"/>
In my error500.aspx
- Just static HTML and containing all the css required for the page.
error500.aspx.cs
- Not sure what to put in here as I don't have any functionality in my aspx page. It looks like this...
using System;
using CMS.Base;
using CMS.DataEngine;
using CMS.Helpers;
using CMS.UIControls;
public partial class SitePages_Errors_error500 : MessagePage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
To test I'm throwing a exception on the page I'm trying to load, e.g.
throw new Exception();
what I get on a browser is a normal Server Error message (not my custom page). In the URL of the page
it does seem to go to my page but something else is breaking...
http://<localhost>/SitePages/Errors/error500.aspx?aspxerrorpath=/CMSPages/PortalTemplate.aspx
Any ideas? :)
I wasn't sure if I needed to copy the code in the default Error.aspx file?