Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 June 13th, 2008, 08:17 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to workidoo
Default web.sitemap

Hello again :)

Have a small problem, or an issue.

It is so that I tested web.sitemap to create menu that you explain in the book. And everything works perfectly what I have a problem with is that when I want to add more siteMapNode.

I have the following error "Exactly one <siteMapNode> elements required immediately inside the element <siteMap>." What this may be due to? I make no changes in MenuWrapper <div> I let it be as it is, in the book.

This is how my code look like:




<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
  <siteMapNode url="~/" title="Home" description="Home">
    <siteMapNode url="~/Default.aspx" title="Home" description="Go to the homepage" />
    <siteMapNode url="~/Reviews/Default.aspx" title="Reviews" description="Rewievs published on this site">
      <siteMapNode url="~/Reviews/AllByGenre.aspx" title="By Genre" description="All Rewievs Grouped by Genre" />
      <siteMapNode url="~/Reviews/All.aspx" title="All Reviews" description="All Rewievs" />
  </siteMapNode>
  <siteMapNode url="~/About/Default.aspx" title="About" description="About this site">
    <siteMapNode url="~/About/Contact.aspx" title="Contact Us" description="Contact Us" />
    <siteMapNode url="~/About/AboutUs.aspx" title="About Us" description="About Us" />
  </siteMapNode>
  <siteMapNode url="~/Login.aspx" title="Login" description="Log in to this web site" />
  </siteMapNode>
  <siteMapNode url="~/TestAbout/Default.aspx" title="Test About" description="About this site">
    <siteMapNode url="~/TestAbout/Contact.aspx" title="Test Contact Us" description="Contact Us" />
    <siteMapNode url="~/TestAbout/AboutUs.aspx" title="Test About Us" description="About Us" />
  </siteMapNode>
</siteMap>




http://www.workidoo.com
__________________
http://www.workidoo.com
 
Old June 13th, 2008, 08:27 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

As the error message explains (which is also explained in the book) you can only have one root element. In your case, Home is the single root element, so you can't add Test About as a second root element. Move Test About into the Home element and the error goes away:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="~/" title="Home" description="Home">
        <siteMapNode url="~/Default.aspx" title="Home" description="Go to the homepage" />
        <siteMapNode url="~/Reviews/Default.aspx" title="Reviews" description="Rewievs published on this site">
            <siteMapNode url="~/Reviews/AllByGenre.aspx" title="By Genre" description="All Rewievs Grouped by Genre" />
            <siteMapNode url="~/Reviews/All.aspx" title="All Reviews" description="All Rewievs" />
        </siteMapNode>
        <siteMapNode url="~/About/Default.aspx" title="About" description="About this site">
            <siteMapNode url="~/About/Contact.aspx" title="Contact Us" description="Contact Us" />
            <siteMapNode url="~/About/AboutUs.aspx" title="About Us" description="About Us" />
        </siteMapNode>
        <siteMapNode url="~/Login.aspx" title="Login" description="Log in to this web site" />
        <siteMapNode url="~/TestAbout/Default.aspx" title="Test About" description="About this site">
            <siteMapNode url="~/TestAbout/Contact.aspx" title="Test Contact Us" description="Contact Us" />
            <siteMapNode url="~/TestAbout/AboutUs.aspx" title="Test About Us" description="About Us" />
        </siteMapNode>
    </siteMapNode>
</siteMap>

Hope this helps,

Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old June 13th, 2008, 08:42 AM
Authorized User
 
Join Date: Jun 2008
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to workidoo
Default

Thank you, it works now. Sometimes it makes me blind.

http://www.workidoo.com




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
Problem with Web.sitemap? Dmitriy ASP.NET 3.5 Professionals 0 October 14th, 2008 07:14 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.