Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 14th, 2008, 07:14 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , .
Posts: 121
Thanks: 1
Thanked 0 Times in 0 Posts
Default Problem with Web.sitemap?

Hello everybody,

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 or sometime Home>Display Name>Multi-Result instead by some reason? What am I doing wrong?


Thanks in advance,
Dmitriy




Similar Threads
Thread Thread Starter Forum Replies Last Post
Web.sitemap problem Dmitriy ASP.NET 3.5 Basics 0 October 14th, 2008 03:04 PM
web.sitemap workidoo BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 June 13th, 2008 08:42 AM
Calling Web.Sitemap from XSLT kwilliams XSLT 9 December 7th, 2007 08:03 PM
One "web.sitemap" for two languages!!?? MTLedari ASP.NET 2.0 Professional 0 May 18th, 2007 01:42 AM
Web.Sitemap Tremmorkeep BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 July 21st, 2006 05:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.