I have a certain page (we’ll call it MyPage) that can be accessed from three different pages. In the Web.sitemap file, I tried to stuff the XML for this page under the three separate nodes like this:
< Page 1 >
< MyPage / >
…
< /Page 1 >
< Page 2 >
< MyPage / >
…
< /Page 2 >
< Page 3 >
< MyPage / >
…
< /Page 3 >
In doing so I received the following error:
Multiple nodes with the same URL ‘Default.aspx’ were found. XmlSiteMapProvider requires that sitemap nodes have unique URLs.
I read online that the SiteMapNodes are stored as a dictionary internally which explains why I can’t use the same URL. In any case, I’m just looking for alternate ways to go about solving this problem. Any suggestions would be greatly appreciated.
That’s not really the intended purpose of the Web.sitemap file.
From MSDN Docs of the SiteMap class,
So, to paraphrase, the web.SiteMap only describes the hierarchy of the pages, and not the relationships between those pages.
However, if your intention is just to have the ‘MyPage’ linked from your other pages, then you don’t need to have MyPage as child nodes of those other pages anyway.
Hope that helps clarify things a little.