There are 2 areas in my project:
Areas | Admin Areas | FrontEnd
I would like that when visiting the site, the default route should load controllers / views / models from the FrontEnd . It's Url/Admin have Url/Admin for the Url/Admin panel, but I would prefer not to force Url/FrontEnd (or some other options). Basically, I don't want to use the Controller / Model / View folders at the root level.
I am not sure how to change the code to allow this or even this is a sensible method. Can someone give some recommendations?
What I have:
routes.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}", new { area = "Admin", controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new[] { "WebsiteEngine.Areas.Admin.Controllers" } ); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { area = "FrontEnd", controller = "Home", action = "Index", id = UrlParameter.Optional }, namespaces: new[] { "WebsiteEngine.Areas.FrontEnd.Controllers" } );
However, this causes an error:
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/Home/Index.aspx ~/Views/Home/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Views/Home/Index.cshtml ~/Views/Home/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml
I have views available in areas, and it doesn't look like it looks there.
webnoob
source share