I am using MvcSiteMapProvider 2.2.1 (http://mvcsitemap.codeplex.com), and am having a problem with creating children under a dynamic node (using a dynamicNodeProvider) when thos
I am using version 1.x. I had a similar problem with dynamic parameters.
I had to modify the source code - made a change in MvcSiteMapNode.cs. This is the new implementation of Url property
public override string Url
{
get
{
if (!string.IsNullOrEmpty(this.url))
return this.url;
RequestContext ctx;
if (HttpContext.Current.Handler is MvcHandler)
ctx = ((MvcHandler)HttpContext.Current.Handler).RequestContext;
else
ctx = new RequestContext(new HttpContextWrapper(HttpContext.Current), new RouteData());
var routeValues = new RouteValueDictionary(RouteValues);
foreach (var key in DynamicParameters)
routeValues.Add(key, ctx.RouteData.Values[key]);
return new UrlHelper(ctx).Action(Action, Controller, routeValues);
}
set
{
this.url = value;
}
}
Notice how actual values of dynamicParameters are added to routeValues collection.
The above change allowed me to define dynamic paremteres in sitemap (like 'id') and create breadcrumbs with links like Account/User/Edit/23.
I took a brief look at version 2.x and you should be able to apply similar patch. Hope it will help you...