0

My controller is "/Home/Index".I want, when i type url to "/Dashboard/Index" or "example.com/Dashboard" my "/Home/Index action method" executed. Can you give me starting point?

1
  • Try changing the name of HomeController to DashboardController Commented Jul 23, 2013 at 7:29

1 Answer 1

2

Just add this route to your route config. Make sure to add it before the default route:

routes.MapRoute(
    name: "HomeRoute",
    url: "Dashboard/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.