p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 3.5 Basics (http://p2p.wrox.com/forumdisplay.php?f=351)
-   -   Web.sitemap problem (http://p2p.wrox.com/showthread.php?t=71027)

Dmitriy October 14th, 2008 03:04 PM

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 [V]


All times are GMT -4. The time now is 03:06 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.