SiteMapPath::NodeTemplate Property
Gets or sets a control template to use for all functional nodes of a site navigation path.
Assembly: System.Web (in System.Web.dll)
[BrowsableAttribute(false)] [PersistenceModeAttribute(PersistenceMode::InnerProperty)] [TemplateContainerAttribute(typeof(SiteMapNodeItem))] public: virtual property ITemplate^ NodeTemplate { ITemplate^ get (); void set (ITemplate^ value); }
<asp:SiteMapPath> <NodeTemplate>ITemplate</NodeTemplate> </asp:SiteMapPath>
Property Value
Type: System.Web.UI::ITemplateAn ITemplate object that implements the InstantiateIn method, to render custom content for each node of a navigation path.
Set the NodeTemplate to an ITemplate object to use an Image or some other control, such as a Label, as a user interface element for all navigation path nodes.
If the NodeTemplate property is set, the template overrides both the navigation node text displayed and any NodeStyle applied to it. For the current and root nodes, if a CurrentNodeTemplate or RootNodeTemplate is set, these templates override the NodeTemplate.
You can declaratively set the NodeTemplate property to any Web server control, and the ASP.NET infrastructure performs the necessary steps to wrap the Web server control as an ITemplate object. 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 a NodeTemplate, when one is specified, overrides styles defined for all nodes, including special styles for the root node and current node.
Security Note |
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Security Note