SPNavigationSiteMapNode.CreateSPNavigationNode method

Creates an SPNavigationNode of the specified name or title, URL, type, and collection to add to.

Namespace:  Microsoft.SharePoint.Publishing.Navigation
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
Public Shared Function CreateSPNavigationNode ( _
    name As String, _
    url As String, _
    nodeType As NodeTypes, _
    collection As SPNavigationNodeCollection _
) As SPNavigationNode
'Usage
Dim name As String
Dim url As String
Dim nodeType As NodeTypes
Dim collection As SPNavigationNodeCollection
Dim returnValue As SPNavigationNode

returnValue = SPNavigationSiteMapNode.CreateSPNavigationNode(name, _
    url, nodeType, collection)
public static SPNavigationNode CreateSPNavigationNode(
    string name,
    string url,
    NodeTypes nodeType,
    SPNavigationNodeCollection collection
)

Parameters

Return value

Type: Microsoft.SharePoint.Navigation.SPNavigationNode
A new SPNavigationNode.

Remarks

This method creates the node as an internally linked node, if possible (internal links to both published and draft items are supported).The type specified can have an important effect on how this node behaves. Heading and Link types are straightforward but an SPNavigationNode can also have an Area type or a Page type. In these cases, the SPNavigationNode becomes a placeholder for the Web site or Web page to which the URL points. Only one Area or Page placeholder is allowed per unique Area or Page; additional placeholder nodes are automatically deleted.

See also

Reference

SPNavigationSiteMapNode class

SPNavigationSiteMapNode members

Microsoft.SharePoint.Publishing.Navigation namespace