dynamically built SiteMapPath in asp.net-Collection of common programming errors

Try this:

Right click on your project “add new item” then choose “Site Map”, it will have an XML structure that looks like:



     

       

         

             

                 

             

         

       

     

** adding description for each node is optional.

Now you need to place it where you want, so you add this code in the HTML side of the page:





   

      

   


Of course you have two pages – one for product and one for prices.

To assign Tile dynamically for some node in the SiteMap; add this code in the Prices Page:

1) In the page load:

SiteMap.SiteMapResolve += new SiteMapResolveEventHandler(SiteMap_SiteMapResolve);

2) Add this function in the same page (prices page):

 SiteMapNode SiteMap_SiteMapResolve(object sender, SiteMapResolveEventArgs e)
{
    SiteMapNode currentNode = SiteMap.CurrentNode.Clone(true);
    SiteMapNode tempNode = currentNode;

    tempNode.ParentNode.Title = "Change the Product name";
    tempNode.ParentNode.Url = "Change the Product url";

    return currentNode;
}

As you can see you can manipulate the parent Node as you want, change the title, the url, etc. I think you want to change the url too; for example: “product.aspx?ID=blah”