T
Tony Johansson
Hello!
CustomerData.aspx
When I run a page I get an exception which is correct and understandable and
not what the question is about.
Some of the text from the exception message is the following
The DELETE statement conflicted with the REFERENCE constraint
"FK_Orders_Customers". The conflict occurred in database "Northwind", table
"dbrders", column 'CustomerID'.
The statement has been terminated.
The question is that I just want to prevent to have the exception displayed
but insted test to redirect to have the ErrorPage.aspx to be executed when
an exception is thrown by adding the ErrorPage directive to the following
page directive in the CustomerData.aspx page. As you can see I have assigned
ErrorPage.aspx to the ErrorPage directive
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="CustomerData.aspx.cs" Inherits="_Default"
ErrorPage="ErrorPage.aspx" %>
According to the documentation should this work but the ugly exception
message is still displayed in the browser.
Is it necessary to make any changes in the web.config to make it work
perhaps ?
Does anyone have any suggestion what I might have missed ?
As a summary I just want to prevent to have the exception being displayed
and instead have the ErrorPage being displayed.
//Tony
CustomerData.aspx
When I run a page I get an exception which is correct and understandable and
not what the question is about.
Some of the text from the exception message is the following
The DELETE statement conflicted with the REFERENCE constraint
"FK_Orders_Customers". The conflict occurred in database "Northwind", table
"dbrders", column 'CustomerID'.
The statement has been terminated.
The question is that I just want to prevent to have the exception displayed
but insted test to redirect to have the ErrorPage.aspx to be executed when
an exception is thrown by adding the ErrorPage directive to the following
page directive in the CustomerData.aspx page. As you can see I have assigned
ErrorPage.aspx to the ErrorPage directive
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="CustomerData.aspx.cs" Inherits="_Default"
ErrorPage="ErrorPage.aspx" %>
According to the documentation should this work but the ugly exception
message is still displayed in the browser.
Is it necessary to make any changes in the web.config to make it work
perhaps ?
Does anyone have any suggestion what I might have missed ?
As a summary I just want to prevent to have the exception being displayed
and instead have the ErrorPage being displayed.
//Tony