SiteMapPath.PathSeparatorTemplate Proprietà

Definizione

Ottiene o imposta un modello di controllo da utilizzare per il delimitatore di percorso di un percorso di navigazione nel sito.

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

Valore della proprietà

ITemplate

Un oggetto ITemplate che implementa il metodo InstantiateIn(Control) per il rendering di contenuto personalizzato per il delimitatore di percorso di un percorso di navigazione.

Attributi

Esempio

Nell'esempio di codice seguente viene illustrato come definire un PathSeparatorTemplate oggetto Image come dichiarativo in un Web Form.

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

Commenti

Impostare su PathSeparatorTemplate un oggetto per usare un ITemplate Image controllo o un altro controllo, ad esempio , Labelcome il delimitatore di percorso tra i nodi di spostamento anziché la PathSeparator stringa.

Se la proprietà è impostata, il modello esegue l'override PathSeparatorTemplate del PathSeparator testo visualizzato e di qualsiasi PathSeparatorStyle oggetto applicato.

È possibile impostare in modo dichiarativo la proprietà su qualsiasi controllo server Web e l'infrastruttura PathSeparatorTemplate ASP.NET esegue i passaggi necessari per eseguire il wrapping del controllo server Web come ITemplate. Tuttavia, i controlli server Web non implementano l'interfaccia ITemplate . Pertanto, quando si lavora con le ITemplate proprietà a livello di codice, è necessario scrivere un ITemplate wrapper per qualsiasi codice modello. PathSeparatorTemplate La proprietà viene quindi impostata su un'istanza ITemplate del wrapper.

Si applica a

Vedi anche