次の方法で共有


SiteMapPath.RootNodeStyle プロパティ

定義

ルート ノードの表示テキストのスタイルを取得します。

public:
 property System::Web::UI::WebControls::Style ^ RootNodeStyle { System::Web::UI::WebControls::Style ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.Style RootNodeStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.RootNodeStyle : System.Web.UI.WebControls.Style
Public ReadOnly Property RootNodeStyle As Style

プロパティ値

Style

Style コントロールのルート ノードの表示テキストに対するスタイル設定を格納した SiteMapPath

属性

次のコード例は、コントロールの属性を宣言によって設定 RootNodeStyle する方法を SiteMapPath 示しています。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。

<%@ Page language="c#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="Form1" method="post" runat="server">

      <p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
            RootNodeStyle-Font-Bold="true"
            RootNodeStyle-Font-Names="Arial Black"
            RootNodeStyle-Font-Italic="True"
            RootNodeStyle-ForeColor="Green"
            CurrentNodeStyle-ForeColor="Orange"/></p>

      <p><asp:Label
            id="Label1"
            runat="server"
            Width="441px"
            Height="64px"
            AssociatedControlID="TextBox1">
                Enter your customer service issue in the space
                provided below, and we will get back to you as
                soon as possible.</asp:Label></p>

      <p><asp:TextBox id="TextBox1" runat="server"
          Width="448px" Height="96px"></asp:TextBox></p>

      <p><asp:Button id="Button1" runat="server"
          Width="112px" Text="Submit"></asp:Button></p>
    </form>
  </body>
</html>
<%@ Page language="VB"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="Form1" method="post" runat="server">

      <p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
            RootNodeStyle-Font-Bold="true"
            RootNodeStyle-Font-Names="Arial Black"
            RootNodeStyle-Font-Italic="True"
            RootNodeStyle-ForeColor="Green"
            CurrentNodeStyle-ForeColor="Orange"/></p>

      <p><asp:Label
            id="Label1"
            runat="server"
            Width="441px"
            AssociatedControlID="TextBox1"
            Height="64px">Enter your customer service issue in the space
                          provided below, and we will get back to you as
                          soon as possible.</asp:Label></p>

      <p><asp:TextBox id="TextBox1" runat="server"
          Width="448px" Height="96px"></asp:TextBox></p>

      <p><asp:Button id="Button1" runat="server"
          Width="112px" Text="Submit"></asp:Button></p>
    </form>
  </body>
</html>

注釈

このプロパティを RootNodeStyle 使用して、ナビゲーション パスのルート ノードの表示テキストの外観を制御します。 既定では、表示テキストは、ページを Title 表すプロパティ SiteMapNode で指定されます。 一般的なスタイル設定には、カスタム背景色、前景色、フォント プロパティ、ノード間隔などがあります。

ノードの場合 SiteMapPath 、スタイル プロパティは次の順序で 1 つのスタイルにマージされます。

  1. NodeStyle

  2. CurrentNodeStyle または RootNodeStyle、ノードの種類に応じて異なります。

注意

ノードのフォント スタイルを取り消し線またはオーバーライン スタイルに設定した場合、ノードの既定の下線スタイルは、明示的に設定 trueされていない限り表示されません。

プロパティが RootNodeTemplate 定義されている場合、 RootNodeStyle プロパティは無視されます。

適用対象

こちらもご覧ください