2

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?

1 Answer 1

4

You could insert the following route definition before the default route:

routes.MapRoute(
    name: "LogOut",
    url: "logout",
    defaults: new { controller = "Account", action = "LogOff" }
);
Sign up to request clarification or add additional context in comments.

1 Comment

wow thanks, it turns out I only needed to change the order of the routes >_< sorry

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.