Question:You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
The application contains two Web pages named OrderDetails.aspx and OrderError.htm.
If the application throws unhandled errors in the OrderDetails.aspx Web page, a stack trace is displayed to remote
users.
You need to ensure that the OrderError.htm Web page is displayed for unhandled errors only in the OrderDetails.aspx
Web page.
What should you do?
A Set the Page attribute for the OrderDetails.aspx Web page in the following manner:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails" %>
Add the following section to the Web.config file:
<customErrors mode="Off" defaultRedirect="OrderError.htm"> </customErrors>
B Set the Page attribute for the OrderDetails.aspx Web page in the following manner:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails"
Debug="true" %>
Add the following section to the Web.config file:
<customErrors mode="On" defaultRedirect="OrderError.htm">
C Set the Page attribute for the OrderDetails.aspx Web page in the following manner:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails"
ErrorPage="~/OrderError.htm" Debug="false" %>
Add the following section to the Web.config file:
<customErrors mode="On"> </customErrors>
D Set the Page attribute for the OrderDetails.aspx Web page in the following manner:
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="OrderDetails.aspx.cs" Inherits="OrderDetails"
Debug="true" ErrorPage="~/OrderError.htm" %>
Add the following section to the Web.config file:
<customErrors mode="Off"> </customErrors>