Asp.net MVC Exception Handling Solution

Source: Internet
Author: User

ApplicationProgramIn the event of an exception, a friendly handling method is provided, and exceptions are recorded and the system administrator or O & M personnel are notified as common scenarios for application development. On the web form, Microsoft provides a toolkit. For details about this toolkit, refer to the recommended toolkit for custom HTTP 404 errors. How can this function be implemented on ASP.net MVC? When creating a project, Asp.net MVC has an error. aspx view under the shared directory of views. This default error processing function does not implement error logs.

Capture all server exceptions, including httpexeptions, for example, 404 errors, and customize the view of error handling. At the same time, record the errors to the database and send them to relevant personnel. The following two blogs are integrated:

Real world error hadnling in ASP. net mvc RC2: http://blogs.microsoft.co.il/blogs/shay/archive/2009/03/06/real-world-error-hadnling-in-asp-net-mvc-rc2.aspx

Elmah with ASP. net mvc: http://darrell.mozingo.net/2009/02/19/elmah-with-aspnet-mvc/

Convert the twoArticleTo obtain a comprehensive solution for exception handling in Asp.net MVC.

Http://www.dotblogs.com.tw/ricochen/archive/2010/03/10/13960.aspx

Http://msdn.microsoft.com/zh-cn/magazine/cc500592.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.