< 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.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
这并不是 Web.sitemap 文件的真正预期目的。
来自 SiteMap 类的 MSDN 文档,
因此,换句话来说,web.SiteMap 仅描述页面的层次结构,而不描述这些页面之间的关系。
但是,如果您的目的只是从其他页面链接“MyPage”,那么无论如何您都不需要将 MyPage 作为这些其他页面的子节点。
希望这有助于澄清一些事情。
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.
我知道您可以有两个不同的 ~/folder/index.aspx 和 ~/folder/ 条目都指向同一个地方。 是的,有点黑客行为,但也许有一种方法可以更进一步?
I know you can have two different entries of ~/folder/index.aspx and ~/folder/ both point to the same place. A bit of a hack, yes, but maybe there's a way you can take this further?
你可以尝试这个......
但是如果你尝试转到“Detail.aspx?node=all&id=13”(我仍在尝试解决这个问题),它就会崩溃。)
You could try this...
But it breaks if you try to go to "Detail.aspx?node=all&id=13" (Which I'm still trying solve.)
一种简单但有效的方法是使用不同的查询字符串进行区分:
尽管它们都指向,但它们在站点地图中都是不同的同一页面。
One simple but effective way is to differentiate by using a different query string:
They're all different in a sitemap, though they all point to the same page.