I am having trouble trying to get a route that works in the area I have.
My area is called ABC, and I have a controller called Home inside the area. I can hit a breakpoint with Home / Index if I look at "http: // localhost: 8000 / abc", however, when I try to click another action called "http: // localhost: 8000 / ABC / details", I get 404.
I tried
context.MapRoute(
"details",
"ABC/Home/{action}/{id}",
new { action = "details", id = UrlParameter.Optional },
constraints: null,
namespaces: new[] { "WebApplication.Areas.ABC.Controllers" }
);
context.MapRoute(
"ABC_Home",
"ABC/{controller}/{action}/{id}",
new { controller = "home",action="Index", id = UrlParameter.Optional },
constraints: null,
namespaces: new[] { "WebApplication.Areas.ABC.Controllers" }
);
This allows me to hit the action if I use "http: // localhost: 8000 / ABC / Home / Details"
context.MapRoute(
"details",
"Home/Home/{action}/{id}",
new {controller="home", action = "details", id = UrlParameter.Optional },
constraints: null,
namespaces: new[] { "WebApplication.Areas.ABC.Controllers" }
);
Ideally, I don't want to use the house in the URL, if possible. What am I doing wrong?
Any help would be awesome!