v4.4.0
Important Default Behavioral Changes
Default HTTP Method
The HttpMethod property of the SiteMap node is used to determine which Action method to use to determine whether or not the user has access. Previously, the default was set to * (or the current request). This behavior doesn't make sense because the default HTML helper code always creates hyperlinks, which do a GET.
Therefore, the default is now to use GET. That is, the AuthorizeAttribute of the Action method that uses HttpGet will be the one that is used to determine whether the user should has access to the node.
This value can still be overridden by setting the httpMethod property of the SiteMap node. The only reason why you might want to change it is if you alter the HTML helpers in some way that causes them to use POST or another HTTP method, which will likely be edge cases.
Node Property Validation
The following validation is now being done on the SiteMap node, and if validation fails you will receive a detailed exception message. Keep this in mind when upgrading, as you might need to fix your node configuration (although it should be pretty unlikely).
- Title is required
- Controller + Action or URL is required
- HttpMethod must be a valid value (or not set)
- RouteValues cannot have the same key as PreservedRouteParameters for the same node
- RouteValues cannot have the same key as InheritedRouteParameters for the same node
Change Log
- Bug: Fix for #230, default value of HttpMethod should be GET.
- Bug: Deleted UrlResolverException because it is never thrown.
- Feature: Changed the URL resolution so it will support the ~/ syntax when setting the Url property.
- Bug: Fix for #222, sitemap links broken when hosted in sub-application.
- Bug: Deprecated overloads of IXmlSiteMapResultFactory that don't include a page number because using them could cause the /sitemap.xml endpoint to stop working when the site reaches 35,000 nodes.
- Feature: Added validation to ensure required node properties are set and that conflicting properties are not used simultaneously.
- Bug: Fix for #231, projects using MvcSiteMapNodeAttribute that have a different project name from assembly name get assigned a value for area when areas are not being used.
- Enhancement: Deprecated AreaName property and created Area property on MvcSiteMapNodeAttribute to be used instead (for consistency with the rest of the project).