Question:

You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application has an ASPX page named ErrorPage.aspx.

You plan to manage the unhandled application exceptions.

You need to perform the following tasks:

Display the ErrorPage.aspx page.

Write the exception information in the Event log file. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A Add the following code fragment to the Web.config file.

<customErrors mode="On" defaultRedirect="ErrorPage.aspx" />

 

B Add the following code fragment to the Web.config file.

<customErrors mode="Off" defaultRedirect="ErrorPage.aspx" />

 

C Add the following code segment to the Global.asax file.

void Application_Error(object sender, EventArgs e)

{

Exception exc = Server.GetLastError();

//Write Exception details to event log

 

D Add the following code segment to the ErrorPage.aspx file.

void Page_Error(object sender, EventArgs e)

{

Exception exc = Server.GetLastError();

//Write Exception details to event log

Server.ClearError();

}

 

+ Answer
+ Report
Total Preview: 1286

Copyright © 2024. Powered by Intellect Software Ltd