ASP.NET MVC Error Handling - Remove aspxerrorpath

前端 未结 5 1482
别那么骄傲
别那么骄傲 2020-12-30 22:45

I\'m working on some error handling in my MVC app, and I\'d like to change asperrorpath to something that doesn\'t give away the fact that I\'m using .NET... so

5条回答
  •  無奈伤痛
    2020-12-30 23:37

    my wprk around is using

    route.MapRoute("NotFound", "{*url}", new {controller = "Home", action = "NotFound"})
    

    At the bottom most, which I have NotFound action in HomeController. It will simply catch all other urls.

提交回复
热议问题