How to get Controller-Level error handling:
This is my map-route:
routes.MapRoute(
    "Default",                                              // Route name
    "{controller}/{action}/{id}",                           // URL with parameters
    new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
);
And I have 2 controllers - HomeController 开发者_如何学Pythonand AwayController
I want both both controllers to handle their own errors
For example, a call to
/Home/InvalidAction would be handled by one method
and
/Away/InvalidAction would be handled by another method
Where InvalidAction currently results in a 404 as there's no Action method with that name
You can override OnUnknownAction method in your controller to catch when a request is made to the controller with no matching action method.  You can also override OnException to catch unhandled exceptions thrown in your controller's action methods.
Andrew
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论