Reputation: 4174
I want to create a custom route that routes like this
when the client request http://server/logout
it will be directed to to AccountController controller and to LogOff method
How to do this in ASP.MVC 4?
Upvotes: 2
Views: 538
Reputation: 1038810
You could insert the following route definition before the default route:
routes.MapRoute(
name: "LogOut",
url: "logout",
defaults: new { controller = "Account", action = "LogOff" }
);
Upvotes: 4