다음을 통해 공유


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 메서드를 구현하는 InstantiateIn(Control) 개체입니다.

특성

예제

다음 코드 예제에는 정의 하는 방법을 보여 줍니다.는 Image 으로 PathSeparatorTemplate 웹 폼에서 선언적으로 합니다.

<%@ 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>

설명

설정를 PathSeparatorTemplateITemplate 개체를 사용 하 여는 Image 또는 다른 컨트롤을 같은 Label, 대신 탐색 노드 간 경로 구분 기호로 PathSeparator 문자열.

경우는 PathSeparatorTemplate 속성을 설정 하면 템플릿을 모두 재정의 합니다 PathSeparator 표시 되는 텍스트 및 PathSeparatorStyle 적용 합니다.

선언적으로 설정할 수 있습니다 합니다 PathSeparatorTemplate 로 웹 서버 컨트롤을 래핑하는 데 필요한 단계를 수행 하는 속성을 모든 웹 서버 컨트롤과 ASP.NET 인프라는 ITemplate합니다. 그러나 웹 서버 컨트롤 구현 하지 않습니다는 ITemplate 인터페이스 이므로 작업을 수행할 때 합니다 ITemplate 속성을 프로그래밍 방식으로 작성 해야 합니다는 ITemplate 모든 템플릿 코드에 대 한 래퍼입니다. 그런 다음, PathSeparatorTemplate 인스턴스의 속성을 ITemplate 래퍼입니다.

적용 대상

추가 정보