Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old June 13th, 2008, 08:27 AM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #3 (permalink)  
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:55 PM.


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