This is sort of a duplicate of http://stackoverflow.com/questions/2045761/trouble-setting-a-default-controller-in-mvc-2-rc-area
But his answer doesn't satisfy me, because it doesn't work.
I have the following
/Areas/TestArea/Controllers/HelloController
/Areas/TestArea/Views/Hello/Index
/Controllers/HomeController
/Views/Home/Index
With the following routes:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
"Default2", // Route name
"TestArea/{controller}/{action}/{id}", // URL with parameters
new { controller = "Hello", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
I added the second one to try and get http://servername/TestArea to work as if it were http://servername/TestArea/Hello but was met with no success. The basic http://servername/ works as intended.
So the question is: how do you return a default controller in an area?
Edit: I have uploaded a sample project to show what I mean: http://beginningasp.net/TestAsync.zip