What should you do to ensure that the OrderError.htm Web page is displayed for unhandled errors?

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?

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>

Explanation:
Debug
Indicates whether the page should be compiled with debug symbols. true if the page should be compiled with debug symbols; otherwise, false. Because this setting affects performance, you should only set the attribute to true during development.
ErrorPage
Defines a target URL for redirection if an unhandled page exception occurs.



Leave a Reply 0

Your email address will not be published. Required fields are marked *