Daniel15 / RouteJs

JavaScript URL routing for ASP.NET MVC and WebForms
84 stars 19 forks source link

Mismatch between how attribute routes inside areas are matched #48

Closed mrahhal closed 6 years ago

mrahhal commented 8 years ago

This is tested in AspNet5 only.

There's a mismatch between how mvc matches some of the routes inside an area that are specified with RouteAttribute and how the javascript route helper is matching them.

The repo that reproduces the issue is here. Basically this is what is happening: capture

For some reason, mvc generates the following route for CategoriesController.Some:

{
        "precedence": 1.11,
        "order": 0,
        "url": "manage/Categories/some.call",
        "defaults": {
            "controller": "Categories",
            "action": "Some"
        },
        "constraints": {},
        "optional": []
    }

That's why routejs thinks it's an attribute route outside any area. I guess we expected mvc to include thearea default also even if the route is attributed.

I'm not sure how we're supposed to solve this if mvc6 is not generating area default in this case. As it appears the logic of matching is not the same between mvc5/mvc6.

Daniel15 commented 8 years ago

Thanks for the bug report, I'll try to take a look. The ASP.NET 5 support is pretty new, so I may have missed some edge cases.