Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

SiteMapPath.CreateControlHierarchy Method

Examines the site map structure provided by the SiteMapProvider and builds a child controls collection based on the styles and templates defined for the functional nodes.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
abstract CreateControlHierarchy : unit -> unit  
override CreateControlHierarchy : unit -> unit
ExceptionCondition
HttpException

No SiteMapProvider is available to the SiteMapPath control.

The CreateControlHierarchy method creates SiteMapNodeItem controls, associates them with the corresponding SiteMapNode objects from the current site map provider, and adds the nodes to the Controls collection.

The method begins by finding the SiteMap.CurrentNode, and then walks up the hierarchical tree of SiteMapNode objects, creating a SiteMapNodeItem for each one until the RootNode is reached. After each SiteMapNodeItem is created, but before it is bound to its corresponding SiteMapNode, the InitializeItem method is called. The InitializeItem method applies any templates or styles defined for a particular node type and creates and initializes any child controls that the SiteMapNodeItem contains. Finally, the InitializeItem method adds the child controls of the SiteMapNodeItem to the Controls collection.

After each SiteMapNodeItem is initialized, the OnItemCreated method is called. Then the SiteMapNodeItem is bound to its corresponding SiteMapNode, and OnDataBound is called.

The CreateControlHierarchy method is called from the CreateChildControls method.

Classes that extend the SiteMapPath control override the CreateControlHierarchy method to alter how the SiteMapNodeItem controls are created or added to the SiteMapPath control. The manipulation of individual node items is performed in the InitializeItem method, and most classes that extend SiteMapPath override that method only.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.