SiteMapNode.Clone Method (Boolean)

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

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

public:
virtual SiteMapNode^ Clone (
	bool cloneParentNodes
)
public SiteMapNode Clone (
	boolean cloneParentNodes
)
public function Clone (
	cloneParentNodes : boolean
) : SiteMapNode
Not applicable.

Parameters

cloneParentNodes

true to clone all parent and ancestor nodes of the current node; otherwise, false.

Return Value

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

If the cloneParentNodes parameter is true, the Clone method recursively clones all direct ancestor nodes and associates them with the current cloned node. Child nodes are not cloned.

The Roles and Attributes collections are applied to new collections.

The following code example demonstrates how to call the Clone method to create a duplicate site map node from the current node. The ExpandForumPaths method is registered to handle the SiteMapResolve event. It uses the Clone method to create a working copy of the current site map node, modify attributes based on personalization data, and return the working copy.

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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: