node for action with parameters with version 2.3.0 don't work?!

Jan 6, 2011 at 9:52 AM

HI,

I just implement MVC site map im my project and everything works fine exept if I have and ID in my URL (like: http://website.com/Article/Details/9296) .

I use Html.MvcSiteMap().SiteMapPath() and I don't have the dynamic ID back in my url. I have the followin : http://website.com/Article/Details

I found an article about this problem for the version 2.0 http://mvcsitemap.codeplex.com/Thread/View.aspx?ThreadId=216801 

Is this problem solved in 2.3.0 ? How can I implement It ? I try to found sample but nothings works.

In advance thanks for your help.

Max.

 

Jan 6, 2011 at 11:12 AM

Can you try adding the SiteMapPreserveRouteData attribute?

[SiteMapPreserveRouteData]
public ViewResult Show(int blogId) {
   // ...
}

Jan 6, 2011 at 1:01 PM

YESSSSSSSSSS. It was the solution.

Many thanks for your quick answer!

Regards,

Max.

 

Jan 28, 2011 at 2:09 PM
Edited Jan 28, 2011 at 2:24 PM

I'm seeing a similar problem with SiteMapPath()

 

[SiteMapPreserveRouteData]		
public ActionResult Details(int id)
{
	// ...	
	return View();
}
/Equipment/Loading/Track/Details/345

 

Adding the Attribute helps in that the SiteMapPath shows SOMETIMES the proper path. The rest of the time it displays no sitemappath at all.

This is using the 2.3.0 download

It seems to correct itself if I leave the url alone for about a minute and refresh the browser, and the breadcrumb shows up correctly.

Feb 4, 2011 at 10:35 AM

Can you try using 2.3.1 from the code branch?