Which approach should you recommend?

You need to design a solution for capturing an exception.
Which approach should you recommend?

You need to design a solution for capturing an exception.
Which approach should you recommend?

A.
Use a Page_Error method.

B.
Use a HandleError attribute.

C.
Use a customErrors element.
D. Use an Application_Error method.

Explanation:
HandleErrorAttribute
Represents an attribute that is used to handle an exception that is thrown by an action method.
The HandleErrorAttribute attribute in ASP.NET MVC lets you specify how to handle an exception that is thrown
by an action method. By default, when an action method with the HandleErrorAttribute attribute throws any
exception, MVC displays the Error view that is located in the ~/Views/Shared folder.
http://msdn.microsoft.com/en-us/library/system.web.mvc.handleerrorattribute.aspx



Leave a Reply 0

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