문제

I'm trapping 404 errors in my MVC website. I have the option to either do that via adding the customerrors element in web.config or application_error, but I don't know which one is better. What is the difference between the two?

도움이 되었습니까?

해결책

I'd recommend you to use the application_error approach. This way you can log the 404'd request data, in a way that you can generate future reports. AFAIK, if you redirect the request using web.config settings, you lose this info.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top