PortalSiteMapProvider.GetChildNodes PortalSiteMapProvider.GetChildNodes PortalSiteMapProvider.GetChildNodes Method

Definition

Overloads

GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, OrderingMethod, AutomaticSortingMethod, Boolean, Int32) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, OrderingMethod, AutomaticSortingMethod, Boolean, Int32) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, OrderingMethod, AutomaticSortingMethod, Boolean, Int32)

Returns a sorted, security-trimmed collection of child nodes for a specified parent node, types of nodes to include, types of hidden nodes to include, and sorting options.

GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, NodeOrder, Boolean) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, NodeOrder, Boolean) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, NodeOrder, Boolean)

This member is reserved for internal use and is not intended to be used directly from your code.

GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes)

Returns a security-trimmed collection of child nodes for a specified parent node, specified node types to include, and specified node types to include if hidden.

GetChildNodes(PortalSiteMapNode, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes)

Returns a security-trimmed collection of child nodes of a specified node type from a specified parent.

GetChildNodes(SiteMapNode) GetChildNodes(SiteMapNode) GetChildNodes(SiteMapNode)

Returns a security-trimmed collection of child nodes from a specified parent node.

GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, OrderingMethod, AutomaticSortingMethod, Boolean, Int32) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, OrderingMethod, AutomaticSortingMethod, Boolean, Int32) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, OrderingMethod, AutomaticSortingMethod, Boolean, Int32)

Returns a sorted, security-trimmed collection of child nodes for a specified parent node, types of nodes to include, types of hidden nodes to include, and sorting options.

public:
 virtual System::Web::SiteMapNodeCollection ^ GetChildNodes(Microsoft::SharePoint::Publishing::Navigation::PortalSiteMapNode ^ node, Microsoft::SharePoint::Publishing::NodeTypes includedTypes, Microsoft::SharePoint::Publishing::NodeTypes includedHiddenTypes, Microsoft::SharePoint::Publishing::OrderingMethod ordering, Microsoft::SharePoint::Publishing::AutomaticSortingMethod method, bool ascending, int lcid);
public virtual System.Web.SiteMapNodeCollection GetChildNodes (Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode node, Microsoft.SharePoint.Publishing.NodeTypes includedTypes, Microsoft.SharePoint.Publishing.NodeTypes includedHiddenTypes, Microsoft.SharePoint.Publishing.OrderingMethod ordering, Microsoft.SharePoint.Publishing.AutomaticSortingMethod method, bool ascending, int lcid);
Public Overridable Function GetChildNodes (node As PortalSiteMapNode, includedTypes As NodeTypes, includedHiddenTypes As NodeTypes, ordering As OrderingMethod, method As AutomaticSortingMethod, ascending As Boolean, lcid As Integer) As SiteMapNodeCollection
Parameters
node
PortalSiteMapNode PortalSiteMapNode PortalSiteMapNode

The node whose child nodes are returned.

includedTypes
NodeTypes NodeTypes NodeTypes

The types of child nodes to return.

includedHiddenTypes
NodeTypes NodeTypes NodeTypes

The types to return even if hidden.

ordering
OrderingMethod OrderingMethod OrderingMethod

The type of ordering to use.

method
AutomaticSortingMethod AutomaticSortingMethod AutomaticSortingMethod

The method of sorting to use with automatic sorting.

ascending
Boolean Boolean Boolean

Whether to use ascending or descending order.

lcid
Int32 Int32 Int32

The locale ID to use for culture sorting.

Returns

A collection of child nodes of types specified that are sorted as specified.

Examples

<p>The following example references the following assemblies:</p>
<ul><li>System.dll</li><li>System.Data.dll</li><li>System.Xml.dll</li><li>System.Web.dll</li><li>System.Configuration.dll</li><li>Microsoft.SharePoint.dll</li><li>Microsoft.SharePoint.Library.dll</li><li>Microsoft.SharePoint.Publishing.dll</li></ul>
<pre><code>using System;

using System.Collections.Generic; using System.Text; using System.Data; using System.Web;

using Microsoft.SharePoint; using Microsoft.SharePoint.Navigation;

using Microsoft.SharePoint.Publishing; using Microsoft.SharePoint.Publishing.Navigation;

namespace Microsoft.SDK.SharePointServer.Samples { class GetChildNodesSample { // Get a list of the navigation headings beneath a specified // Web site in current navigation. This method must be called from // within a current and valid HttpContext object. public static List&lt;string&gt;GetNavigationHeadingTitles(string serverRelativeWebUrl) { List&lt;string&gt; titles = null;

        // Get a reference to the current navigation provider:
        // the one that doesn't HTML-encode titles.
        PortalSiteMapProvider portalProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode;
        // lookup the node for the given Web site URL.
        PortalWebSiteMapNode webNode = 
            portalProvider.FindSiteMapNode(serverRelativeWebUrl) as PortalWebSiteMapNode;

        if (webNode != null)
        {
            // Retrieve the heading nodes beneath the 
            // specified Web site.
            SiteMapNodeCollection headingNodes = 
                portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None);

            titles = new List&amp;lt;string&amp;gt;(headingNodes.Count);

            foreach (PortalSiteMapNode headingNode in headingNodes)
            {
                // Add the title to the list.
                titles.Add(headingNode.Title);
            }
        }

        // Return the list of titles.
        return titles;
    }
}

}

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Web

Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Navigation

Imports Microsoft.SharePoint.Publishing
Imports Microsoft.SharePoint.Publishing.Navigation

Namespace Microsoft.SDK.SharePointServer.Samples
    Friend Class GetChildNodesSample
        ' Get a list of the navigation headings beneath a specified
        ' Web site in current navigation. This method must be called from
        ' within a current and valid HttpContext object.
        Public Shared Function GetNavigationHeadingTitles(ByVal serverRelativeWebUrl As String) As List(Of String)
            Dim titles As List(Of String) = Nothing

            ' Get a reference to the current navigation provider:
            ' the one that doesn't HTML-encode titles.
            Dim portalProvider As PortalSiteMapProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode
            ' lookup the node for the given Web site URL.
            Dim webNode As PortalWebSiteMapNode = TryCast(portalProvider.FindSiteMapNode(serverRelativeWebUrl), PortalWebSiteMapNode)

            If webNode IsNot Nothing Then
                ' Retrieve the heading nodes beneath the 
                ' specified Web site.
                Dim headingNodes As SiteMapNodeCollection = portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None)

                titles = New List(Of String)(headingNodes.Count)

                For Each headingNode As PortalSiteMapNode In headingNodes
                    ' Add the title to the list.
                    titles.Add(headingNode.Title)
                Next headingNode
            End If

            ' Return the list of titles.
            Return titles
        End Function
    End Class
End Namespace

GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, NodeOrder, Boolean) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, NodeOrder, Boolean) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes, NodeOrder, Boolean)

This member is reserved for internal use and is not intended to be used directly from your code.

public:
 System::Web::SiteMapNodeCollection ^ GetChildNodes(Microsoft::SharePoint::Publishing::Navigation::PortalSiteMapNode ^ node, Microsoft::SharePoint::Publishing::NodeTypes includedTypes, Microsoft::SharePoint::Publishing::NodeTypes includedHiddenTypes, Microsoft::SharePoint::Publishing::NodeOrder ordering, bool ascending);
public System.Web.SiteMapNodeCollection GetChildNodes (Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode node, Microsoft.SharePoint.Publishing.NodeTypes includedTypes, Microsoft.SharePoint.Publishing.NodeTypes includedHiddenTypes, Microsoft.SharePoint.Publishing.NodeOrder ordering, bool ascending);
Public Function GetChildNodes (node As PortalSiteMapNode, includedTypes As NodeTypes, includedHiddenTypes As NodeTypes, ordering As NodeOrder, ascending As Boolean) As SiteMapNodeCollection
Parameters
node
PortalSiteMapNode PortalSiteMapNode PortalSiteMapNode

Reserved for internal use.

includedTypes
NodeTypes NodeTypes NodeTypes

Reserved for internal use.

includedHiddenTypes
NodeTypes NodeTypes NodeTypes

Reserved for internal use.

ordering
NodeOrder NodeOrder NodeOrder

Reserved for internal use.

ascending
Boolean Boolean Boolean

Reserved for internal use.

Returns

GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes, NodeTypes)

Returns a security-trimmed collection of child nodes for a specified parent node, specified node types to include, and specified node types to include if hidden.

public:
 virtual System::Web::SiteMapNodeCollection ^ GetChildNodes(Microsoft::SharePoint::Publishing::Navigation::PortalSiteMapNode ^ node, Microsoft::SharePoint::Publishing::NodeTypes includedTypes, Microsoft::SharePoint::Publishing::NodeTypes includedHiddenTypes);
public virtual System.Web.SiteMapNodeCollection GetChildNodes (Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode node, Microsoft.SharePoint.Publishing.NodeTypes includedTypes, Microsoft.SharePoint.Publishing.NodeTypes includedHiddenTypes);
Public Overridable Function GetChildNodes (node As PortalSiteMapNode, includedTypes As NodeTypes, includedHiddenTypes As NodeTypes) As SiteMapNodeCollection
Parameters
node
PortalSiteMapNode PortalSiteMapNode PortalSiteMapNode

The node whose child nodes are returned.

includedTypes
NodeTypes NodeTypes NodeTypes

The types of child nodes to return.

includedHiddenTypes
NodeTypes NodeTypes NodeTypes

The types to return even if hidden.

Returns

A Microsoft.SharePoint.Publishing.SiteMapNodeCollection object of child nodes security-trimmed for the current user.

Examples

<p>The following example references the following assemblies:</p>
<ul><li>System.dll</li><li>System.Data.dll</li><li>System.Xml.dll</li><li>System.Web.dll</li><li>System.Configuration.dll</li><li>Microsoft.SharePoint.dll</li><li>Microsoft.SharePoint.Library.dll</li><li>Microsoft.SharePoint.Publishing.dll</li></ul>
<pre><code>using System;

using System.Collections.Generic; using System.Text; using System.Data; using System.Web;

using Microsoft.SharePoint; using Microsoft.SharePoint.Navigation;

using Microsoft.SharePoint.Publishing; using Microsoft.SharePoint.Publishing.Navigation;

namespace Microsoft.SDK.SharePointServer.Samples { class GetChildNodesSample { // Get a list of the navigation headings beneath a specified // Web site in current navigation. This method must be called from // within a current and valid HttpContext object. public static List&lt;string&gt;GetNavigationHeadingTitles(string serverRelativeWebUrl) { List&lt;string&gt; titles = null;

        // Get a reference to the current navigation provider:
        // the one that doesn't HTML-encode titles.
        PortalSiteMapProvider portalProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode;
        // Look up the node for the given Web site URL.
        PortalWebSiteMapNode webNode = 
            portalProvider.FindSiteMapNode(serverRelativeWebUrl) as PortalWebSiteMapNode;

        if (webNode != null)
        {
            // Retrieve the heading nodes beneath the 
            // specified Web site.
            SiteMapNodeCollection headingNodes = 
                portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None);

            titles = new List&amp;lt;string&amp;gt;(headingNodes.Count);

            foreach (PortalSiteMapNode headingNode in headingNodes)
            {
                // Add the title to the list.
                titles.Add(headingNode.Title);
            }
        }

        // Return the list of titles.
        return titles;
    }
}

}

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Web

Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Navigation

Imports Microsoft.SharePoint.Publishing
Imports Microsoft.SharePoint.Publishing.Navigation

Namespace Microsoft.SDK.SharePointServer.Samples
    Friend Class GetChildNodesSample
        ' Get a list of the navigation headings beneath a specified
        ' Web site in current navigation. This method must be called from
        ' within a current and valid HttpContext object.
        Public Shared Function GetNavigationHeadingTitles(ByVal serverRelativeWebUrl As String) As List(Of String)
            Dim titles As List(Of String) = Nothing

            ' Get a reference to the current navigation provider:
            ' the one that doesn't HTML-encode titles.
            Dim portalProvider As PortalSiteMapProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode
            ' Look up the node for the given Web site URL.
            Dim webNode As PortalWebSiteMapNode = TryCast(portalProvider.FindSiteMapNode(serverRelativeWebUrl), PortalWebSiteMapNode)

            If webNode IsNot Nothing Then
                ' Retrieve the heading nodes beneath the 
                ' specified Web site.
                Dim headingNodes As SiteMapNodeCollection = portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None)

                titles = New List(Of String)(headingNodes.Count)

                For Each headingNode As PortalSiteMapNode In headingNodes
                    ' Add the title to the list.
                    titles.Add(headingNode.Title)
                Next headingNode
            End If

            ' Return the list of titles.
            Return titles
        End Function
    End Class
End Namespace

GetChildNodes(PortalSiteMapNode, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes) GetChildNodes(PortalSiteMapNode, NodeTypes)

Returns a security-trimmed collection of child nodes of a specified node type from a specified parent.

public:
 virtual System::Web::SiteMapNodeCollection ^ GetChildNodes(Microsoft::SharePoint::Publishing::Navigation::PortalSiteMapNode ^ node, Microsoft::SharePoint::Publishing::NodeTypes includedHiddenTypes);
public virtual System.Web.SiteMapNodeCollection GetChildNodes (Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapNode node, Microsoft.SharePoint.Publishing.NodeTypes includedHiddenTypes);
Public Overridable Function GetChildNodes (node As PortalSiteMapNode, includedHiddenTypes As NodeTypes) As SiteMapNodeCollection
Parameters
node
PortalSiteMapNode PortalSiteMapNode PortalSiteMapNode

The node whose children are returned.

includedHiddenTypes
NodeTypes NodeTypes NodeTypes

The types to return even if hidden.

Returns

A Microsoft.SharePoint.SiteMapNodeCollection object of child nodes security-trimmed for the current user.

Examples

<p>The following example references the following assemblies:</p>
<ul><li>System.dll</li><li>System.Data.dll</li><li>System.Xml.dll</li><li>System.Web.dll</li><li>System.Configuration.dll</li><li>Microsoft.SharePoint.dll</li><li>Microsoft.SharePoint.Library.dll</li><li>Microsoft.SharePoint.Publishing.dll</li></ul>
<pre><code>using System;

using System.Collections.Generic; using System.Text; using System.Data; using System.Web;

using Microsoft.SharePoint; using Microsoft.SharePoint.Navigation;

using Microsoft.SharePoint.Publishing; using Microsoft.SharePoint.Publishing.Navigation;

namespace Microsoft.SDK.SharePointServer.Samples { class GetChildNodesSample { // Get a list of the navigation headings beneath a specified // Web site in current navigation. This method must be called from // within a current and valid HttpContext object. public static List&lt;string&gt;GetNavigationHeadingTitles(string serverRelativeWebUrl) { List&lt;string&gt; titles = null;

        // Get a reference to the current navigation provider:
        // the one that doesn't HTML-encode titles.
        PortalSiteMapProvider portalProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode;
        // Look up the node for the given Web site URL.
        PortalWebSiteMapNode webNode = 
            portalProvider.FindSiteMapNode(serverRelativeWebUrl) as PortalWebSiteMapNode;

        if (webNode != null)
        {
            // Retrieve the heading nodes beneath the 
            // specified Web site.
            SiteMapNodeCollection headingNodes = 
                portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None);

            titles = new List&amp;lt;string&amp;gt;(headingNodes.Count);

            foreach (PortalSiteMapNode headingNode in headingNodes)
            {
                // Add the title to the list.
                titles.Add(headingNode.Title);
            }
        }

        // Return the list of titles.
        return titles;
    }
}

}

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Web

Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Navigation

Imports Microsoft.SharePoint.Publishing
Imports Microsoft.SharePoint.Publishing.Navigation

Namespace Microsoft.SDK.SharePointServer.Samples
    Friend Class GetChildNodesSample
        ' Get a list of the navigation headings beneath a specified
        ' Web site in current navigation. This method must be called from
        ' within a current and valid HttpContext object.
        Public Shared Function GetNavigationHeadingTitles(ByVal serverRelativeWebUrl As String) As List(Of String)
            Dim titles As List(Of String) = Nothing

            ' Get a reference to the current navigation provider:
            ' the one that doesn't HTML-encode titles.
            Dim portalProvider As PortalSiteMapProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode
            ' Look up the node for the given Web site URL.
            Dim webNode As PortalWebSiteMapNode = TryCast(portalProvider.FindSiteMapNode(serverRelativeWebUrl), PortalWebSiteMapNode)

            If webNode IsNot Nothing Then
                ' Retrieve the heading nodes beneath the 
                ' specified Web site.
                Dim headingNodes As SiteMapNodeCollection = portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None)

                titles = New List(Of String)(headingNodes.Count)

                For Each headingNode As PortalSiteMapNode In headingNodes
                    ' Add the title to the list.
                    titles.Add(headingNode.Title)
                Next headingNode
            End If

            ' Return the list of titles.
            Return titles
        End Function
    End Class
End Namespace

Remarks

This object passes to a GetNavigationChildren(NodeTypes) method.

GetChildNodes(SiteMapNode) GetChildNodes(SiteMapNode) GetChildNodes(SiteMapNode)

Returns a security-trimmed collection of child nodes from a specified parent node.

public:
 override System::Web::SiteMapNodeCollection ^ GetChildNodes(System::Web::SiteMapNode ^ node);
public override System.Web.SiteMapNodeCollection GetChildNodes (System.Web.SiteMapNode node);
Public Overrides Function GetChildNodes (node As SiteMapNode) As SiteMapNodeCollection
Parameters
node
SiteMapNode SiteMapNode SiteMapNode

The node whose children are returned.

Returns

A security-trimmed SiteMapNodeCollection object of child nodes.

Examples

<p>The following example references the following assemblies:</p>
<ul><li>System.dll</li><li>System.Data.dll</li><li>System.Xml.dll</li><li>System.Web.dll</li><li>System.Configuration.dll</li><li>Microsoft.SharePoint.dll</li><li>Microsoft.SharePoint.Library.dll</li><li>Microsoft.SharePoint.Publishing.dll</li></ul>
<pre><code>using System;

using System.Collections.Generic; using System.Text; using System.Data; using System.Web;

using Microsoft.SharePoint; using Microsoft.SharePoint.Navigation;

using Microsoft.SharePoint.Publishing; using Microsoft.SharePoint.Publishing.Navigation;

namespace Microsoft.SDK.SharePointServer.Samples { class GetChildNodesSample { // Get a list of the navigation headings beneath a specified // Web cell in current navigation. This method must be called from // within a current and valid HttpContext object. public static List&lt;string&gt;GetNavigationHeadingTitles(string serverRelativeWebUrl) { List&lt;string&gt; titles = null;

        // Get a reference to the current navigation provider:
        // the one that doesn't HTML-encode titles.
        PortalSiteMapProvider portalProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode;
        // Look up the node for the given Web site URL.
        PortalWebSiteMapNode webNode = 
            portalProvider.FindSiteMapNode(serverRelativeWebUrl) as PortalWebSiteMapNode;

        if (webNode != null)
        {
            // Retrieve the heading nodes beneath the 
            // specified Web site.
            SiteMapNodeCollection headingNodes = 
                portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None);

            titles = new List&amp;lt;string&amp;gt;(headingNodes.Count);

            foreach (PortalSiteMapNode headingNode in headingNodes)
            {
                // Add the title to the list.
                titles.Add(headingNode.Title);
            }
        }

        // Return the list of titles.
        return titles;
    }
}

}

Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Web

Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Navigation

Imports Microsoft.SharePoint.Publishing
Imports Microsoft.SharePoint.Publishing.Navigation

Namespace Microsoft.SDK.SharePointServer.Samples
    Friend Class GetChildNodesSample
        ' Get a list of the navigation headings beneath a specified
        ' Web cell in current navigation. This method must be called from
        ' within a current and valid HttpContext object.
        Public Shared Function GetNavigationHeadingTitles(ByVal serverRelativeWebUrl As String) As List(Of String)
            Dim titles As List(Of String) = Nothing

            ' Get a reference to the current navigation provider:
            ' the one that doesn't HTML-encode titles.
            Dim portalProvider As PortalSiteMapProvider = PortalSiteMapProvider.CurrentNavSiteMapProviderNoEncode
            ' Look up the node for the given Web site URL.
            Dim webNode As PortalWebSiteMapNode = TryCast(portalProvider.FindSiteMapNode(serverRelativeWebUrl), PortalWebSiteMapNode)

            If webNode IsNot Nothing Then
                ' Retrieve the heading nodes beneath the 
                ' specified Web site.
                Dim headingNodes As SiteMapNodeCollection = portalProvider.GetChildNodes(webNode, NodeTypes.Heading, NodeTypes.None)

                titles = New List(Of String)(headingNodes.Count)

                For Each headingNode As PortalSiteMapNode In headingNodes
                    ' Add the title to the list.
                    titles.Add(headingNode.Title)
                Next headingNode
            End If

            ' Return the list of titles.
            Return titles
        End Function
    End Class
End Namespace

Applies to