Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

share|improve this question
 
Try changing the name of HomeController to DashboardController –  Dylan Slabbinck Jul 23 '13 at 7:29
 
I dont want that. –  fuat Jul 23 '13 at 8:21
add comment

1 Answer

up vote 0 down vote accepted

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 }
);
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.