Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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" /`>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top