SiteMapPath.CurrentNodeTemplate プロパティ
アセンブリ: System.Web (system.web.dll 内)

<TemplateContainerAttribute(GetType(SiteMapNodeItem))> _ Public Overridable Property CurrentNodeTemplate As ITemplate
Dim instance As SiteMapPath Dim value As ITemplate value = instance.CurrentNodeTemplate instance.CurrentNodeTemplate = value
[TemplateContainerAttribute(typeof(SiteMapNodeItem))] public virtual ITemplate CurrentNodeTemplate { get; set; }
[TemplateContainerAttribute(typeof(SiteMapNodeItem))] public: virtual property ITemplate^ CurrentNodeTemplate { ITemplate^ get (); void set (ITemplate^ value); }
/** @property */ public ITemplate get_CurrentNodeTemplate () /** @property */ public void set_CurrentNodeTemplate (ITemplate value)
public function get CurrentNodeTemplate () : ITemplate public function set CurrentNodeTemplate (value : ITemplate)
現在表示されているページを表すナビゲーション パス ノードのカスタム コンテンツを表示するために InstantiateIn メソッドを実装した ITemplate オブジェクト。

CurrentNodeTemplate に ITemplate オブジェクトを設定して、Image コントロールまたは Label などの他のコントロールを現在のノードのユーザー インターフェイス要素として文字列の代わりに使用します。
CurrentNodeTemplate プロパティを設定した場合、テンプレートは表示される現在のナビゲーション ノード テキストとそれに適用される CurrentNodeStyle の両方をオーバーライドします。ただし、現在表示されているページがルート ノードに対応する場合は、RootNodeTemplate か RootNodeStyle が使用されます。
CurrentNodeTemplate プロパティは、宣言によって任意の Web サーバー コントロールに設定でき、ASP.NET インフラストラクチャが、必要な手順を実行して、Web サーバー コントロールを ITemplate オブジェクトとしてラップします。ただし、Web サーバー コントロールは ITemplate インターフェイスを実装しません。このため、ITemplate プロパティをプログラムによって操作する場合は、テンプレート コードの ITemplate ラッパーを記述する必要があります。その後、CurrentNodeTemplate プロパティが ITemplate ラッパーのインスタンスに設定されます。

宣言によって CurrentNodeTemplate を定義し、定義済みの CurrentNodeStyle をオーバーライドするコード例を次に示します。
<%@ Page Language="VB" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat="server"> </SCRIPT> <HTML> <BODY> <FORM runat="server"> <!-- The following example demonstrates some of the orders of precedence when applying styles and templates to functional nodes of a SiteMapPath. The NodeStyle and RootNodeStyle define the same attributes, but are different and conflict with each other: the RootNodeStyle supersedes NodeStyle, and is the style rendered. Notice, however, that the underline style defined by NodeStyle is still applied. Both a CurrentNodeStyle and a CurrentNodeTemplate are defined. A template supersedes a style for a node type, so CurrentNodeTemplate is displayed and CurrentNodeStyle is ignored. --> <asp:SiteMapPath ID="SiteMapPath1" runat="server" RenderCurrentNodeAsLink="true" NodeStyle-Font-Name="Franklin Gothic Medium" NodeStyle-Font-Underline="true" NodeStyle-Font-Bold="true" RootNodeStyle-Font-Name="Symbol" RootNodeStyle-Font-Bold="false" CurrentNodeStyle-Font-Name="Verdana" CurrentNodeStyle-Font-Size="10pt" CurrentNodeStyle-Font-Bold="true" CurrentNodeStyle-ForeColor="red" CurrentNodeStyle-Font-Underline="false" HoverNodeStyle-ForeColor="blue" HoverNodeStyle-Font-Underline="true"> <CURRENTNODETEMPLATE> <asp:Image id="Image1" runat="server" ImageUrl="WebForm2.jpg" AlternateText="WebForm2"/> </CURRENTNODETEMPLATE> </asp:SiteMapPath> </FORM> </BODY> </HTML>
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat="server"> </SCRIPT> <HTML> <BODY> <FORM runat="server"> <!-- The following example demonstrates some of the orders of precedence when applying styles and templates to functional nodes of a SiteMapPath. The NodeStyle and RootNodeStyle define the same attributes, but are different and conflict with each other: the RootNodeStyle supersedes NodeStyle, and is the style rendered. Notice, however, that the underline style defined by NodeStyle is still applied. Both a CurrentNodeStyle and a CurrentNodeTemplate are defined. A template supersedes a style for a node type, so CurrentNodeTemplate is displayed and CurrentNodeStyle is ignored. --> <asp:SiteMapPath ID="SiteMapPath1" runat="server" RenderCurrentNodeAsLink="true" NodeStyle-Font-Name="Franklin Gothic Medium" NodeStyle-Font-Underline="true" NodeStyle-Font-Bold="true" RootNodeStyle-Font-Name="Symbol" RootNodeStyle-Font-Bold="false" CurrentNodeStyle-Font-Name="Verdana" CurrentNodeStyle-Font-Size="10pt" CurrentNodeStyle-Font-Bold="true" CurrentNodeStyle-ForeColor="red" CurrentNodeStyle-Font-Underline="false" HoverNodeStyle-ForeColor="blue" HoverNodeStyle-Font-Underline="true"> <CURRENTNODETEMPLATE> <asp:Image id="Image1" runat="server" ImageUrl="WebForm2.jpg" AlternateText="WebForm2"/> </CURRENTNODETEMPLATE> </asp:SiteMapPath> </FORM> </BODY> </HTML>
<%@ Page Language="VJ#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <SCRIPT runat="server"> </SCRIPT> <HTML> <BODY> <FORM runat="server"> <!-- The following example demonstrates some of the orders of precedence when applying styles and templates to functional nodes of a SiteMapPath. The NodeStyle and RootNodeStyle define the same attributes, but are different and conflict with each other: the RootNodeStyle supercedes NodeStyle, and is the style rendered. Notice, however, that the underline style defined by NodeStyle is still applied. Both a CurrentNodeStyle and a CurrentNodeTemplate are defined. A template supercedes a style for a node type, so CurrentNodeTemplate is displayed and CurrentNodeStyle is ignored. --> <asp:SiteMapPath ID="SiteMapPath1" runat="server" RenderCurrentNodeAsLink="true" NodeStyle-Font-Name="Franklin Gothic Medium" NodeStyle-Font-Underline="true" NodeStyle-Font-Bold="true" RootNodeStyle-Font-Name="Symbol" RootNodeStyle-Font-Bold="false" CurrentNodeStyle-Font-Name="Verdana" CurrentNodeStyle-Font-Size="10pt" CurrentNodeStyle-Font-Bold="true" CurrentNodeStyle-ForeColor="red" CurrentNodeStyle-Font-Underline="false" HoverNodeStyle-ForeColor="blue" HoverNodeStyle-Font-Underline="true"> <CURRENTNODETEMPLATE> <asp:Image id="Image1" runat="server" ImageUrl="WebForm2.jpg" AlternateText="WebForm2"/> </CURRENTNODETEMPLATE> </asp:SiteMapPath> </FORM> </BODY> </HTML>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSiteMapPath.CurrentNodeTemplate プロパティを検索する場合は、下記のリンクをクリックしてください。

- SiteMapPath.CurrentNodeTemplate プロパティのページへのリンク