views:

446

answers:

0

If you use Server.Transfer to save the extra roundtrips caused by Response.Redirect, the SiteMapPath gets out of synch and displays the previous page information in the breadcrumb. I have spent hours trying to change the CurrentNode from code, but just can't get it to work. That particular property is read-only.

The MSDN recommendation to use the SiteMapResolve event didn't work for me. I think that my problem here is that this website has a MasterPage and two nested base pages. And three different sitemap XML files from which one is chosen dynamically (to have different menus for admins, managers and regular users) in the base pages. I can manage to change the CurrentNode in code, but somehow by the time the code cycles through all of those page load and init events and the page finally renders, it's reverted to the previous page text.

My work-around for the affected pages (those using Server.Transfer) is to hide the SiteMapPath, and replace it with a Label. But that's an inelegant solution.

Can you point me to where the last point is in the code where the SiteMapPath's CurrentNode is set? And suggest how to alter it there -- access the CurrentNode property and call my own SiteMapResolve method?