mohammad reza
mohammad reza

Reputation: 3442

ASP.NET site map configuration error

I have received this error, but don't know what it means:

System.Configuration.ConfigurationErrorsException: Exactly one <siteMapNode> element is required directly inside the <siteMap> element.

Can you help me?

Upvotes: 4

Views: 2539

Answers (2)

Boris Brdarić
Boris Brdarić

Reputation: 4684

If you are building menu from sitemap and you don't want to have all menu items in one node, then you can hide starting node in SiteMapDataSource with attribute

ShowStartingNode="false"

For example:

<asp:SiteMapDataSource ID="MainMenuSiteMap" SiteMapProvider="MainMenuProvider" ShowStartingNode="false" runat="server" /`>

Upvotes: 2

Kjensen
Kjensen

Reputation: 12384

Could be something with sitemap... I googled and found this:

http://forums.asp.net/t/1245553.aspx

The site map has to have a single root siteMapNode element, underneath which all other elements reside. So you have:

<siteMap>
    <siteMapNode title="Home" ...>
        all other nodes
    </siteMapNode>
</siteMap>

This means that all nodes are at least a child of the root node. When displaying the Menu you can chose to not show the root node, or to show both it and the child nodes together.

Upvotes: 11

Related Questions