I set the default route object to the controller ("Beheer") inside the area (also called "Beheer").
Like this:
routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Beheer", action = "Index", id = UrlParameter.Optional } // Parameter defaults );
He can find this controller and action within the scope, but he cannot find the view, because it only looks in these places:
~/Views/Beheer/Index.aspx ~/Views/Beheer/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/Beheer/Index.cshtml ~/Views/Beheer/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml
While it should look in this place:
~/Beheer/Views/Beheer/Index.aspx
How can I make him search there?
I already tried:
routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { area = "Beheer", controller = "Beheer", action = "Index", id = UrlParameter.Optional } // Parameter defaults );
And I tried this (with namespaces):
routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Beheer", action = "Index", id = UrlParameter.Optional }, // Parameter defaults new[] { "Areas.Beheer" } );
But nothing changes. It introduces the correct action in the correct controller, but cannot find a representation.