XmlSiteMapProvider.AddNode(SiteMapNode, SiteMapNode) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a SiteMapNode object to the collections that are maintained by the current provider.
protected public:
override void AddNode(System::Web::SiteMapNode ^ node, System::Web::SiteMapNode ^ parentNode);
protected internal override void AddNode (System.Web.SiteMapNode node, System.Web.SiteMapNode parentNode);
override this.AddNode : System.Web.SiteMapNode * System.Web.SiteMapNode -> unit
Protected Friend Overrides Sub AddNode (node As SiteMapNode, parentNode As SiteMapNode)
Parameters
- node
- SiteMapNode
The SiteMapNode to add to the provider.
- parentNode
- SiteMapNode
The SiteMapNode under which to add node
.
Exceptions
node
or parentNode
is null
.
The current XmlSiteMapProvider is not the provider associated with node
.
A node with the same URL or key is already registered with the XmlSiteMapProvider. - or -
A duplicate site map node has been encountered programmatically, such as when linking two site map providers.
-or-
node
is the root node of the XmlSiteMapProvider.
Remarks
The node
parameter is added to an internal collection, and a parent/child relationship is created between it and parentNode
.
The XmlSiteMapProvider class, derived from the StaticSiteMapProvider class and the default site map provider for ASP.NET, uses the Url property of a SiteMapNode object as a lookup key in its internal collections, by default. If the Url property of the SiteMapNode is set, it must be unique within the scope of the provider. The FindSiteMapNode method attempts to retrieve nodes based on their Url. Otherwise, you can use the Key property, and the corresponding FindSiteMapNodeFromKey method, to retrieve nodes.
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈