-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] Integration with RouteLocalization library? #357
Comments
MvcSiteMapProvider is designed to work with the System.Web.Routing framework, in particular to work with subclasses of Route and RouteBase, as long as both the GetRouteData and GetVirtualPath methods are set up to be exact mirror images of each other for the incoming and outgoing route. The incoming route is to match a resource (typically a controller action) and the outgoing route is to generate a URL. MvcSiteMapProvider uses both. I took a look at the source in that library and I don't see any reason why it wouldn't work with MvcSiteMapProvider, but do keep in mind that all route parameters of the request (whether you or a 3rd party supplies them) must be configured to match, either by supplying 1 node per route combination or using preservedRouteParameters to force a particular parameter to match regardless of its value. I suggest you set a breakpoint in your controller action and analyze the following 2 things (and perhaps the rest of the RouteData information) carefully to ensure there is nothing about the route that is unusual (extra route parameters, route information being tucked into a nested route key that is NOT named "MS_DirectRouteMatches", etc.)
It would also be helpful to know how MvcSiteMapProvider is not working. Is it failing to show up at all, or are the URLs incorrect? |
"It would also be helpful to know how MvcSiteMapProvider is not working. Is it failing to show up at all, or are the URLs incorrect?" The menu is showing, but the links are not right. |
Turns out it is RouteLocalization issue. There are some string comparasions issues: Dresel/RouteLocalization#19 (comment) |
Okay, good to know. FYI - when the URL resolves as "#", it means that MVC couldn't resolve the URL with any of the configured routes. You can always use the code here inside of a controller to determine if the URL will resolve within MVC, and if not the problem is most definitely not with MvcSiteMapProvider, but with the route configuration. |
I'm using this library: https://github.com/Dresel/RouteLocalization
Looks like MvcSiteMapProvider isn't working when I add that library. Notice that the library created LocalizationRoute which inherits from Route.
Is that an issue?
The text was updated successfully, but these errors were encountered: