Asp.Net 2.0 Web Site Map (Web.sitemap)

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I have 2 questions about Asp.Net 2.0 web.sitemap:

1. Where can I find the list of all siteMapNode attributes?

I looked eveywhere and couldn't find it.

2. I created a Web.sitemap and somehowI am getting an error:

"The element siteMap in the namespace
'http://schemas/microsoft.com/AspNet/SiteMap-File.1.0' has invalid
child element 'siteMapaNode' in namespace
"http://schemas.microsoft.com/AspNet/SiteMap-File.1.0".


My Web.sitemap file is:

<?xml version="1.0" encoding="utf-8" ?>
<siteMap
enableLocalization = "true"
xmlns = "http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode
url = "~/default.aspx"
changefreq = "Daily"
description = ""
priority = "0.5"
resourceKey = "Default"
title = "" />
<siteMapNode
url = "~/collection.aspx"
changefreq = "Daily"
description = ""
priority = "0.5"
resourceKey = "Collection"
title = "" />
</siteMap>


Could someone, please, help me on these two questions?

Thanks,

Miguel
 
Url, Title, and Description are the only attributes required by each
siteMapNode. You can add other attributes if you wish, but you cannot add
other elements or you'll get the error message you described.

Here's more info:
http://SteveOrr.net/articles/SiteMaps.aspx
 
Sorry,

But I am completly lost on this.
So if I have 3 pages in my web site: default.aspx, collection.aspx and
contacts.aspx how would my Web.sitemap look?

Thanks,
Miguel
 
Hi,

VS2005 creates the default Web.sitemap as follows:
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="">
<siteMapNode url="" title="" description="" />
<siteMapNode url="" title="" description="" />
</siteMapNode>
</siteMap>

Which means there must be a parent siteMapNode.
In most examples I saw this parent is used as default.
But why placing default.aspx as a parent?

Anyway, can and should I leave it empty?

I am getting the error because I am using:

<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="" title="" description="" />
<siteMapNode url="" title="" description="" />
</siteMap>

Thanks,
 
You can leave the parent siteMapNode's default attribute empty if you want,
but the parent siteMapNode must be present in order for it to be a valid
site map file. That's why you're getting the error.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top