PrepAway - Latest Free Exam Questions & Answers

What change should you suggest?

You create Web-based client applications. You are reviewing a Web application page that populates a list of all employees of your company. You analyze code and find that the Web application page does not prevent exceptions from traveling to the browser. You need to ensure that the Web application page intercepts exceptions and presents an error message to the browser. What change should you suggest?

PrepAway - Latest Free Exam Questions & Answers

A.
Add the following code segment to the Web.config file.
<system.web>
<compilation debug=”true”/>
</system.web>

B.
Add the following code segment to the page.
protected void Page_Error(object sender, EventArgs e) {
Response.Redirect(“error.aspx”);
}

C.
Add the following code segment to the Web.config file.
<system.web>
<customErrors mode=”Off”/>
</system.web>

D.
Change the load event handler to the following code segment.
protected void Page_Load(object sender, EventArgs e) {
try {
LoadEmployees();
}
Catch {
Response.Redirect(“error.aspx”);
}
}


Leave a Reply