I don't completely understand how to use routing in asp.net mvc. I've organized my views and controllers in 2 main folders: frontoffice and backoffice. Now I'd like to have the actions inside backoffice that build the url in this way: frontoffice/controller/action/parameters And the ones inside the folder frontoffice in the classical way: controller/action/parameter
I wrote these rules but they aren't correct
routes.MapRoute(
name: "Backoffice",
url: "Backoffice/{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "Frontoffice",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
In this way all the action inside frontoffice builds url with 'backoffice'. How should I do it?