I'm trying to set a default web page for errors in my site. I wrote this in my web.config:
customErrors defaultRedirect="~/ErrorPage.aspx" mode="RemoteOnly">
error redirect="~/Sitefinity/nopermissions.aspx" statusCode="403"/>
I set a wrong connectionstring for one of my data sources, and I ran it from other machine. The result is that the page is steal and there is not a redirection.
After that I set mode="On" and debug it. The error has occurred and the site is steal.
I set the following in the Global.asax it works properly - shows the custom error page.
void Application_Error(object sender, EventArgs e)
// DONE IN WEB.CONFIG
Exception ex = Server.GetLastError();
if (ex is HttpException)
HttpException httpEx = ex as HttpException;
if (httpEx.ErrorCode == 403 || httpEx.Source.StartsWith("Telerik.Cms"))
else if (ex is Telerik.Security.SecurityApplicationException)
But I'd like to use the web.config for that because I want to set mode to RemoteOnly and I want to manipulate its value.
Do you have any advices?
I have Sitefinity 3.7.
My Error page has no code behind.