This documentation is archived and is not being maintained.

SiteMapPath::RootNodeTemplate Property

Gets or sets a control template to use for the root node of a site navigation path.

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

[BrowsableAttribute(false)]
[PersistenceModeAttribute(PersistenceMode::InnerProperty)]
[TemplateContainerAttribute(typeof(SiteMapNodeItem))]
public:
virtual property ITemplate^ RootNodeTemplate {
	ITemplate^ get ();
	void set (ITemplate^ value);
}
<asp:SiteMapPath>
	<RootNodeTemplate>ITemplate</RootNodeTemplate>
</asp:SiteMapPath>

Property Value

Type: System.Web.UI::ITemplate
An ITemplate object that implements the InstantiateIn method, to render custom content for the root node of a navigation path.

Set the RootNodeTemplate to an ITemplate object to use an Image control or some other control, such as a Label as the root node's user interface element instead of a string.

If the RootNodeTemplate property is set, the template overrides both the root navigation node text displayed and any RootNodeStyle applied to it. The template also overrides the CurrentNodeTemplate and CurrentNodeStyle properties if the root page is the currently displayed page.

You can declaratively set the RootNodeTemplate property to any Web server control, and the ASP.NET infrastructure performs the necessary steps to wrap the Web server control as an ITemplate. However, Web server controls do not implement the ITemplate interface; therefore, when you work with the ITemplate properties programmatically, you must write an ITemplate wrapper for any template code. Then, the RootNodeTemplate property is set to an instance of the ITemplate wrapper.

The following code example demonstrates how to programmatically define a class that implements the ITemplate interface to wrap an Image control. Then, the RootNodeTemplate property is set to an instance of the class.

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0
Show: