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


NodeStyle プロパティを使用して、コントロールによって表示されるすべてのナビゲーション パス ノードの表示テキストの外観を制御します。既定では、ページを表す SiteMapNode の Title プロパティで指定された表示テキストです。スタイルの共通設定には、カスタムの背景色、前景色、フォントのプロパティ、およびノードのスペーシングが含まれます。
SiteMapPath のノードの場合、スタイルのプロパティは次の順序で 1 つのスタイルにマージされます。
![]() |
---|
ノードのフォント スタイルを取り消し線または上線付きのスタイルに設定した場合、ノードの既定の下線付きスタイルは、明示的に true に設定しない限り表示されません。 |
NodeStyle が定義されている場合、最初に各ノードに適用されます。ルート ノードや現在のノードなど、ノードの特定の型に対して追加のスタイルが定義されている場合、このスタイルが NodeStyle プロパティで指定される一般的なスタイルの代わりに使用されます。特定のノード型に対してテンプレートが定義されている場合は、そのノードに定義されているすべてのスタイルよりも優先されます。

SiteMapPath ノードに対するスタイルの優先順位を示すため、RootNodeStyle でマージされる NodeStyle を定義する方法を次のコード例に示します。
<%@ 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.NodeStyle プロパティを検索する場合は、下記のリンクをクリックしてください。

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