I have a page where I would like to put a SiteMapPath control on it. However, this page does not exist in the sitemap, so the SiteMapPath is not populating when it can't find the current page in the sitemap.
I want to dictate, just for the page request, what the currentNode of the sitemap should be so that the SiteMapPath can be correctly rendered. I started working with SiteMapPathResolve but found that it only fires once and this affects all other pages in the site, so at this point that is not a workable solution.
Any help would be greatly appreciated!
Thanks,
Matt
I am using the AspNetSqlSiteMapProvider outlined here:
http://msdn.microsoft.com/msdnmag/issues/06/02/WickedCode/
I have links in the sitemap that have identical url's. To avoid the error, before I call "AddNode," I am putting a unique id on the end of the url, then after calling "AddNode", I am resetting the url to exactly how I want it. That is the url that is used to derive the links, but it is not the one used when determining the current page on the sitemap.
For example, let's say I have 1 "about" page but 2 links in the sitemap that point to it I call "AddNode" with url's "about.aspx?id=1172" and "about.aspx?id=1408", and then reset the node's url to "about.aspx" so that I get the desired href. When the page is accessed as "about.aspx" it does not match up with the url's used for "AddNode" and then my SiteMapPath control has no currentNode and will not display anything.
I solved the problem by overriding "CurrentNode" in the AspNetSiteMapProvider, to grab the additional information I needed to finish the request.
0 comments:
Post a Comment