Two controllers, same name and mapping, different areas #83
Comments
At first glance, your area code doesn't look right. When you define an area, you need to also give it a type, so that it can scope that namespace.
What you are trying to do I've done recently, so it is possible. I would recommend making an AdminRouteSet and connecting it to your default one. |
After posting my previous comment I realized your issue might be in your view / url generation. Be sure to include the area when generating your urls.
The "area" parameter is only necessary when you are generating the area url from outside the area (I hope that makes sense). As a gotcha, when you want to leave an area, be sure to set the area to an empty parameter.
Routes are a really strange beast with nuance that is easily missed. Took me years to figure them out, hopefully I can shorten that time for you :). |
I've put a sample with this issue and issue #82 on the following repo: https://github.com/dvolvenl/RestfulRoutingNotHappening What you can do to test this issue is:
|
Was caused by using .Resource instead of .Resources. |
I have two productscontrollers, one for an admin area and one for outside of it. The admin area one is in namespace
Project.Admin.Controllers
and the normal one is inProject.Controllers
. My routes are configured like this:The resulting error I get when running the application is:
When removing the
p.Only("index")
statement, the app runs, but when I look at the RouteDebug I see that there is no Index route for the normal ProductsController, which is basically the only action that is actually implemented in there. The Admin version has all actions implemented. Why is no Index action route being generated in this case?The text was updated successfully, but these errors were encountered: