There are regular pages on the site such as:
foo.com/about
foo.com/contact
I use single controller for these.
There is also pages for admin, i have a seperate controller:
foo.com/admin/createsomething
This is my routing config and it is not picking HomeController Actions.
routes.MapRoute(
name: "Default",
url: "{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
routes.MapRoute(
name: "Admin",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
How can i fix it?
You need routes for the urls that break the default convention:
then your admin url should resolve with the default route, where you have an
AdminControllerand aCreateSomethingaction method