maartenba/MvcSiteMapProvider — Issue #10: Hybrid MVC Project, Breadcrumbs, and Parent WebForm Node
Author: visoft
Created: 2012-01-05 17:42:39+00:00
State: open

I am working in an ASP.NET WebForm project where I've integrated ASP.NET MVC. I am using the MvcSiteMapProvider mainly for breadcrumbs. Within my sitemap, my MVC page is listed as a child of a WebForms page. The WebForms page requires an id parameter to be passed to it. Right now I'm just using the Edit controller method, so I simply set the parent node url within the action (I found this in the old Codeplex issues) like so:

SiteMap.CurrentNode.ParentNode.Url = string.Format("~/Company.aspx?id={0}", id);

Seems like a good solution, but it only occasionally works. Sometimes I get correct id, somethings I get an incorrect one (like an old ID) and sometimes I don't get the querystring at all. Here's the sitemap snippet

I figured that it might be a cache issue, so I tried setting the cacheduration to 0 in the web.confg, but it didn't seem to do anything. I'm hoping it's something obviously that I am missing here.

Thanks for your help,
-Damien