View Single Post
  #1 (permalink)  
Old October 14th, 2008, 03:04 PM
Dmitriy Dmitriy is offline
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
Posts: 121
Thanks: 1
Thanked 0 Times in 0 Posts
Default Web.sitemap problem

Hello,

I have an “unexplainable” problem with the “SiteMapPath” control and Web.Sitemap files I’ve created. In my particular case I have to go to same set of pages from different part of my application. The problem with the Web.Sitemap file is you can not to use same URL in different nodes in same file. So, to go around this problem I’ve created several additional web.sitemap files and call them from my main Web.Sitemap file using the siteMapFile property as shown below:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/SearchMenu.aspx" title="Home" >
    <siteMapNode url="~/UserDisplayName.aspx" title="Display Name" >
      <siteMapNode siteMapFile="WebDispayName.sitemap"/>
    </siteMapNode>
    <siteMapNode url="~/UserFirstName.aspx" title="First Name" >
      <siteMapNode siteMapFile="WebFirstName.sitemap"/>
    </siteMapNode>
    <siteMapNode url="~/UserLastName.aspx" title="Last Name" >
      <siteMapNode siteMapFile="WebLastName.sitemap">
    </siteMapNode>
    <siteMapNode url="~/ContactInformation.aspx" title="Contacts" />
  </siteMapNode>
</siteMap>



All auxiliary web.sitemap files are shown below.

This is WebDispayName.sitemap file:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode >
    <siteMapNode url="~/MultiResult.aspx" title="Multi-Result" />
    <siteMapNode url="~/SingleResult.aspx" title="Single Result" />
    <siteMapNode url="~/MessageForm.aspx" title="Message Page" />
    <siteMapNode url="~/ErrorForm.aspx" title="Error Page" />
  </siteMapNode>
</siteMap>

This is WebFirstName.sitemap file:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode >
    <siteMapNode url="~/MultiResult.aspx" title="Multi-Result" />
    <siteMapNode url="~/SingleResult.aspx" title="Single Result" />
    <siteMapNode url="~/MessageForm.aspx" title="Message Page" />
    <siteMapNode url="~/ErrorForm.aspx" title="Error Page" />
  </siteMapNode>
</siteMap>


This is WebLastName.sitemap file:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode >
    <siteMapNode url="~/MultiResult.aspx" title="Multi-Result" />
    <siteMapNode url="~/SingleResult.aspx" title="Single Result" />
    <siteMapNode url="~/MessageForm.aspx" title="Message Page" />
    <siteMapNode url="~/ErrorForm.aspx" title="Error Page" />
  </siteMapNode>
</siteMap>


You can see, all auxiliary files looking the same. The problem is, if I go, for example, from the UserFirstName.aspx page to the MultiResult.aspx page, I should see in the SiteMapPath control like this:
Home>First Name>Multi-Result , but I see Home>Last Name>Multi-Result instead by some reason? What am I doing wrong?

Thanks in advance for your help,
Dmitriy