maartenba / MvcSiteMapProvider

An ASP.NET MVC SiteMapProvider implementation for the ASP.NET MVC framework.
Microsoft Public License
538 stars 218 forks source link

SiteMaps.Current.FindSiteMapNodeFromCurrentContext() returns null #410

Closed AGuyCalledGerald closed 9 years ago

AGuyCalledGerald commented 9 years ago

I use the method SiteMaps.Current.FindSiteMapNodeFromCurrentContext() to return the current node. This does not work if the node has a custom attribute. If the custom attribute is empty or removed altogether, everything works fine. I use .Net MVC 5 and SitemapProvider v 4.6.18

NightOwl888 commented 9 years ago

When using custom attributes, you must add them to the AttributesToIgnore configuration setting or they will automatically be taken into account when matching the node and when resolving the URL.

AGuyCalledGerald commented 9 years ago

Thank you, it works now.

NightOwl888 commented 9 years ago

You're welcome.