Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 February 25th, 2011, 04:38 PM
Authorized User
 
Join Date: Feb 2011
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default Ch.7 Pg.247 - Web.sitemap

I copied the programming from the downloaded resources file (see below) and it still doesn't compile properly. Intellisense says "The element "SiteMap" has invalid child element "SiteMapNode" for the second SiteMapNode - url="~/About"

When I view the "default.aspx" in the browser I get a compile error
"Exactly one <siteMapNode> element is required directly inside the <siteMap> element."

Anyone else have this issue?

-------copied from Resource file----------------
<?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="Reviews published on this site" />
<siteMapNode url="~/Reviews/AllByGenre.aspx" title="By Genre" description="All Reviews Grouped by Genre" />
<siteMapNode url="~/Reviews/All.aspx" title="All Reviews" description="All Reviews" />
</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>
</siteMap>
-------------end copied from resource file--------------
 
Old February 25th, 2011, 05:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You're closing off the first siteMapNode to early. Something like this should work:

Code:
 
<?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="Reviews published on this site" />
    <siteMapNode url="~/Reviews/AllByGenre.aspx" title="By Genre" description="All Reviews Grouped by Genre" />
    <siteMapNode url="~/Reviews/All.aspx" title="All Reviews" description="All Reviews" />
    <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>
</siteMap>
Hope ths helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 7 Page 247 VWD flags errors ken evans BOOK: Beginning ASP.NET 4 : in C# and VB 1 October 16th, 2010 11:04 AM
Web.sitemap lustigon BOOK: Beginning ASP.NET 4 : in C# and VB 3 October 6th, 2010 11:40 AM
Web.sitemap & Breadcrumbs - Ch 7 btcomp BOOK: Beginning ASP.NET 4 : in C# and VB 0 August 18th, 2010 02:55 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
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.