maartenba/MvcSiteMapProvider — Issue #8: PreservedRouteParameters only preserving Url segments not query string
Author: eulerfx
Created: 2011-12-29 19:31:26+00:00
State: open

I have an action method that looks like this:

public ActionResult Details(int id, int feedId, int columnId)

I would like for all parameters, including "id", "feedId", and "columnId" to be part of the Url when this particular node appears in cookie crumbs. However, the problem seems to be that when the Url is being resolved in DefaultSiteMapNodeUrlResolver, the values for "feedId" and "columnId" are not part of the RouteData.Values collection. They are however part of Request.Uri. I made a quick hack that in addition to looking for a preservedParameterName value in the RouteData object it also looks at the Request.QueryString collection. This seems to work, however it is a hacky.