Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 March 26th, 2006, 06:48 PM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default SiteMap Problems

I have been playing around with making a sitemap and have run into a problem. This is the error that I get when I try to run the site.

Exactly one <siteMapNode> element is required directly inside the <siteMap> element.

Here is a basic sitemap that I have ben playing with

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
    <siteMapNode url="default.aspx" title="Home" description="Home">
    </siteMapNode>
    <siteMapNode url="default1.aspx" title="Home1" description="Home1"></siteMapNode>
</siteMap>

Any ideas what I am doing wrong?
Reply With Quote
  #2 (permalink)  
Old March 27th, 2006, 01:17 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I think what the error message is saying is that you need one, and only one "root" node, that in turn can have multiple sub nodes. Right now, your sitemap defines two siteMapNodes that server as the root, which is not OK.

Nest each subsequent element in the first "Home" element:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0">
    <siteMapNode url="default.aspx" title="Home" description="Home">
      <siteMapNode url="default1.aspx" title="Home1"    
            description="Home1"></siteMapNode>
      <siteMapNode url="default2.aspx" title="Home1"    
            description="Home2"></siteMapNode>
    </siteMapNode>
</siteMap>
HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote
  #3 (permalink)  
Old September 5th, 2006, 12:31 AM
Registered User
 
Join Date: Aug 2006
Location: Auckland, , New Zealand.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The siteMap remind me of the navigation used in Microsoft UIP (Ages ago) . “siteMap” should have only one <siteMap> node. And one and only main <siteMapNode>. That doesn’t mean you cant group your child pages to a logical <siteMapNode>. Its best to show a proper example. Make sure to have the “url” attribute unique. That will be the internal unique identifier. Have a look at the bellowing sample.

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
    <siteMapNode url="Default.aspx" title="Home" description="The default page" >
      <siteMapNode url= "ManageStock/Default.aspx" title="Home2" description="The default page" >
        <siteMapNode url="ManageStock/Page1.aspx" title="Run1" description="another page"/>
        <siteMapNode url="ManageStock/Page2.aspx" title="Run2" description="another page"/>
      </siteMapNode>

      <siteMapNode url= "BuyStock/Default.aspx" title="Home3" description="The default page" >
        <siteMapNode url="BuyStock/Page1.aspx" title="Run1" description="another page"/>
        <siteMapNode url="BuyStock/Page2.aspx" title="Run2" description="another page"/>
      </siteMapNode>
    </siteMapNode>
  </siteMap>



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
Sitemap melania ASP.NET 3.5 Basics 0 October 27th, 2008 01:20 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
Sitemap Problems mattid ASP.NET 2.0 Basics 1 May 29th, 2006 01:13 AM
chapter 3 sitemap try it out diango BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 January 16th, 2006 11:40 AM



All times are GMT -4. The time now is 09:33 PM.


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