Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望从特定节点开始的站点地图中获取一组子节点。我查看了 Microsoft 文档,但并不真正知道如何使用它。
谁能给我一个例子?
如果您在 mvcSiteMapNode 上设置密钥,如下所示:
<mvcSiteMapNode title="My Action" action="MyAction" controller="MyController" key="1234" />
您可以调用 FindSiteMapNodeFromKey() 来获取对该节点的引用。
var node = MvcSiteMapProvider.SiteMaps.Current.FindSiteMapNodeFromKey("1234");