SiteMapPath.PathSeparatorTemplate プロパティ

定義

サイト ナビゲーション パスのパス デリミターに使用するコントロール テンプレートを取得または設定します。

public:
 virtual property System::Web::UI::ITemplate ^ PathSeparatorTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
[System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.SiteMapNodeItem))]
public virtual System.Web.UI.ITemplate PathSeparatorTemplate { get; set; }
[<System.ComponentModel.Browsable(false)>]
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
[<System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.SiteMapNodeItem))>]
member this.PathSeparatorTemplate : System.Web.UI.ITemplate with get, set
Public Overridable Property PathSeparatorTemplate As ITemplate

プロパティ値

ITemplate

ナビゲーション パスの各ノードのパス デリミターの内容を表示する、ITemplate メソッドを実装した InstantiateIn(Control) オブジェクト。

属性

次のコード例は、Web フォームで宣言型としてPathSeparatorTemplate定義Imageする方法を示しています。

<%@ 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>About Us</title>
</head>
<body>
    <form id="Form1" method="post" runat="server">
      <asp:SiteMapPath
          runat="server"
          ID="SiteMapPath1"
          RootNodeStyle-Font-Names="Verdana"
          RootNodeStyle-Font-Italic="True"
          RootNodeStyle-ForeColor="Blue"
          CurrentNodeStyle-ForeColor="Red">
          <PATHSEPARATORTEMPLATE>
              <asp:Image id="Image1" runat="server" 
                GenerateEmptyAlternateText="true" 
                ImageUrl="6.jpg"></asp:Image>
          </PATHSEPARATORTEMPLATE>
        </asp:SiteMapPath>
        <h1>About Us</h1>
      <p>This company was founded in 1899, as the demand for widgets grew.</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>About Us</title>
</head>
<body>
    <form id="Form1" method="post" runat="server">
      <asp:SiteMapPath
          runat="server"
          ID="SiteMapPath1"
          RootNodeStyle-Font-Names="Verdana"
          RootNodeStyle-Font-Italic="True"
          RootNodeStyle-ForeColor="Blue"
          CurrentNodeStyle-ForeColor="Red">
          <PATHSEPARATORTEMPLATE>
              <asp:Image id="Image1" runat="server" 
                GenerateEmptyAlternateText="true" 
                ImageUrl="6.jpg"></asp:Image>
          </PATHSEPARATORTEMPLATE>
        </asp:SiteMapPath>
        <h1>About Us</h1>
      <p>This company was founded in 1899, as the demand for widgets grew.</p>
    </form>
  </body>
</html>

注釈

PathSeparatorTemplate ITemplate文字列の代わりにナビゲーション ノード間のパス区切り記号として、オブジェクトを設定して、その他のコントロール (a などLabel) をPathSeparator使用Imageします。

プロパティがPathSeparatorTemplate設定されている場合、テンプレートは表示されるテキストとPathSeparatorStyleそれに適用されたテキストのPathSeparator両方をオーバーライドします。

プロパティは宣言によって任意の PathSeparatorTemplate Web サーバー コントロールに設定でき、ASP.NET インフラストラクチャは Web サーバー コントロールを 1 つの Web サーバー コントロールとしてラップするために必要な手順をITemplate実行します。 ただし、Web サーバー コントロールはインターフェイスを ITemplate 実装しないため、プログラムでプロパティを ITemplate 操作する場合は、任意のテンプレート コードのラッパーを記述する ITemplate 必要があります。 その後、 PathSeparatorTemplate プロパティはラッパーのインスタンスに ITemplate 設定されます。

適用対象

こちらもご覧ください