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?
Asked
Active
Viewed 3,054 times
0
-
Try changing the name of HomeController to DashboardController – Dylan Slabbinck Jul 23 '13 at 07:29
1 Answers
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 }
);

Steve Michelotti
- 5,223
- 1
- 25
- 30