Sunday, July 23, 2006
SiteMap ASP 2.0 - No root node
If you are using the new Menu Control for the first time in ASP.Net 2.0, after defining your site map file, you might encounter an error like this:
Yes, it's true. The site map xml file expects a root siteMapNode under the siteMap element. You're probably thinking, "what the f**?surely Microsoft is not dumb enough to think that web site menus all have one single menu item from which other menus stem from?" You're right, they're not that dumb.
All you have to do is go to your SiteMapDataSource control which you must have dropped on your page, click on it, and set the property ShowStartingNode to false.
It's a bit awkward, but, hey, at least they gave us the option.
If you are using the new Menu Control for the first time in ASP.Net 2.0, after defining your site map file, you might encounter an error like this:
Exactly one <sitemapnode> element is required directly inside the <sitemap> element.
Yes, it's true. The site map xml file expects a root siteMapNode under the siteMap element. You're probably thinking, "what the f**?surely Microsoft is not dumb enough to think that web site menus all have one single menu item from which other menus stem from?" You're right, they're not that dumb.
All you have to do is go to your SiteMapDataSource control which you must have dropped on your page, click on it, and set the property ShowStartingNode to false.
It's a bit awkward, but, hey, at least they gave us the option.
