SiteMapNode Class
TOC
Collapse the table of content
Expand the table of content

SiteMapNode Class

 

Represents a node in the hierarchical site map structure such as that described by the SiteMap class and classes that implement the abstract SiteMapProvider class.

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

System::Object
  System.Web::SiteMapNode

public ref class SiteMapNode : ICloneable, IHierarchyData, INavigateUIData

NameDescription
System_CAPS_pubmethodSiteMapNode(SiteMapProvider^, String^)

Initializes a new instance of the SiteMapNode class, using the specified key to identify the page that the node represents and the site map provider that manages the node.

System_CAPS_pubmethodSiteMapNode(SiteMapProvider^, String^, String^)

Initializes a new instance of the SiteMapNode class using the specified URL, a key to identify the page that the node represents, and the site map provider that manages the node.

System_CAPS_pubmethodSiteMapNode(SiteMapProvider^, String^, String^, String^)

Initializes a new instance of the SiteMapNode class using the specified URL, a key to identify the page that the node represents, a title, and the site map provider that manages the node.

System_CAPS_pubmethodSiteMapNode(SiteMapProvider^, String^, String^, String^, String^)

Initializes a new instance of the SiteMapNode class using the specified URL, a key to identify the page that the node represents, a title and description, and the site map provider that manages the node.

System_CAPS_pubmethodSiteMapNode(SiteMapProvider^, String^, String^, String^, String^, IList^, NameValueCollection^, NameValueCollection^, String^)

Initializes a new instance of the SiteMapNode class using the specified site map provider that manages the node, URL, title, description, roles, additional attributes, and explicit and implicit resource keys for localization.

NameDescription
System_CAPS_protpropertyAttributes

Gets or sets a collection of additional attributes beyond the strongly typed properties that are defined for the SiteMapNode class.

System_CAPS_pubpropertyChildNodes

Gets or sets all the child nodes of the current SiteMapNode object from the associated SiteMapProvider provider.

System_CAPS_pubpropertyDescription

Gets or sets a description for the SiteMapNode.

System_CAPS_pubpropertyHasChildNodes

Gets a value indicating whether the current SiteMapNode has any child nodes.

System_CAPS_pubpropertyItem[String^]

Gets or sets a custom attribute from the Attributes collection or a resource string based on the specified key.

System_CAPS_pubpropertyKey

Gets a string representing a lookup key for a site map node.

System_CAPS_pubpropertyNextSibling

Gets the next SiteMapNode node on the same hierarchical level as the current one, relative to the ParentNode property (if one exists).

System_CAPS_pubpropertyParentNode

Gets or sets the SiteMapNode object that is the parent of the current node.

System_CAPS_pubpropertyPreviousSibling

Gets the previous SiteMapNode object on the same level as the current one, relative to the ParentNode object (if one exists).

System_CAPS_pubpropertyProvider

Gets the SiteMapProvider provider that the SiteMapNode object is tracked by.

System_CAPS_pubpropertyReadOnly

Gets or sets a value indicating whether the site map node can be modified.

System_CAPS_pubpropertyResourceKey

Gets or sets the resource key that is used to localize the SiteMapNode.

System_CAPS_pubpropertyRoles

Gets or sets a collection of roles that are associated with the SiteMapNode object, used during security trimming.

System_CAPS_pubpropertyRootNode

Gets the root node of the root provider in a site map provider hierarchy. If no provider hierarchy exists, the RootNode property gets the root node of the current provider.

System_CAPS_pubpropertyTitle

Gets or sets the title of the SiteMapNode object.

System_CAPS_pubpropertyUrl

Gets or sets the URL of the page that the SiteMapNode object represents.

NameDescription
System_CAPS_pubmethodClone()

Creates a new node that is a copy of the current node.

System_CAPS_pubmethodClone(Boolean)

Creates a new copy that is a copy of the current node, optionally cloning all parent and ancestor nodes of the current node.

System_CAPS_pubmethodEquals(Object^)

Gets a value indicating whether the current SiteMapNode is identical to the specified object. (Overrides Object::Equals(Object^).)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetAllNodes()

Retrieves a read-only collection of all SiteMapNode objects that are descendants of the calling node, regardless of the degree of separation.

System_CAPS_pubmethodGetDataSourceView(SiteMapDataSource^, String^)

Retrieves the SiteMapDataSourceView object that is associated with the current node.

System_CAPS_protmethodGetExplicitResourceString(String^, String^, Boolean)

Retrieves a localized string based on a SiteMapNode attribute to localize, a default string to return if no resource is found, and a Boolean value indicating whether to throw an exception if no resource is found.

System_CAPS_pubmethodGetHashCode()

Returns the hash code of the SiteMapNode object. (Overrides Object::GetHashCode().)

System_CAPS_pubmethodGetHierarchicalDataSourceView()

Retrieves the SiteMapHierarchicalDataSourceView object that is associated with the current node.

System_CAPS_protmethodGetImplicitResourceString(String^)

Gets a localized string based on the attribute name and ResourceKey property that is specified by the SiteMapProvider by which the SiteMapNode is tracked.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIsAccessibleToUser(HttpContext^)

Gets a value indicating whether the specified site map node can be viewed by the user in the specified context.

System_CAPS_pubmethodIsDescendantOf(SiteMapNode^)

Gets a value indicating whether the current site map node is a child or a direct descendant of the specified node.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Converts the value of this instance of the SiteMapNode class to its equivalent string representation.(Overrides Object::ToString().)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICloneable::Clone()

This API supports the product infrastructure and is not intended to be used directly from your code. Creates a new node that is a copy of the current node. For a description of this member, see ICloneable::Clone.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIHierarchyData::GetChildren()

Retrieves the hierarchical children data items of the current item. For a description of this member, see IHierarchyData::GetChildren.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIHierarchyData::GetParent()

Retrieves the hierarchical parent of the current item. For a description of this member, see IHierarchyData::GetParent.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIHierarchyData::HasChildren

Gets a value that indicates whether the current SiteMapNode object has any child nodes. For a description of this member, see IHierarchyData::HasChildren.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIHierarchyData::Item

Gets the hierarchical data item. For a description of this member, see IHierarchyData::Item.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIHierarchyData::Path

Gets the path of the hierarchical data item. For a description of this member, see IHierarchyData::Path.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIHierarchyData::Type

Gets a string that represents the type name of the hierarchical data item. For a description of this member, see IHierarchyData::Type.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyINavigateUIData::Description

Gets the Description property of the site map node. For a description of this member, see INavigateUIData::Description.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyINavigateUIData::Name

Gets the Title property of the site map node. For a description of this member, see INavigateUIData::Name.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyINavigateUIData::NavigateUrl

Gets the Url property of the site map node. For a description of this member, see INavigateUIData::NavigateUrl.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyINavigateUIData::Value

Gets the Title property of the site map node. For a description of this member, see INavigateUIData::Value.

A SiteMapNode object represents a Web site page in a site map structure. SiteMapNode objects are loaded by the static SiteMap class at run time using one or more site map providers to load site map data from persistent storage into memory. SiteMapNode objects are wrapped by the SiteMapNodeItem class for use by Web server controls, such as the SiteMapPath control.

The SiteMapNode class includes several properties that are used to describe a single page in a Web site, including properties that describe a page, such as the Url, Title, and Description properties. Whereas the Url property is used by the XmlSiteMapProvider class, which is the default site map provider for ASP.NET, as a lookup key in the internal collections that the provider uses to track nodes, the SiteMapNode class supports a basic Key property that can be used by site map providers to track nodes. Additionally, the Url property is used by navigation controls to render hyperlinks to pages within a navigation structure. The Title property is a friendly name for the SiteMapNode, is often the same as the HTML title of a Web Form, and is used by navigation controls to render simple labels. Finally, a NameValueCollection collection of additional Attributes attributes is available to site map providers that use SiteMapNode objects, but require additional properties that are not available in the base SiteMapNode class.

This section contains two code examples. The first code example demonstrates how to create a new site map node collection and add elements to it. The second code example demonstrates how to load site map data from a text file.

The following code example demonstrates how to use the SiteMapNodeCollection constructor to create a new SiteMapNodeCollection collection, and then add elements to it with the Add method.

No code example is currently available or this language may not be supported.

The following code example demonstrates how the SimpleTextSiteMapProvider parses a text file that contains site map data in comma-delimited strings. A new SiteMapNode object is added to the internal tracking collections of the class for each line that is read from the file.

This code example is part of a larger example provided for the SiteMapProvider class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft