Export (0) Print
Expand All

SiteMapPath.PathSeparatorTemplate Property

Gets or sets a control template to use for the path delimiter of a site navigation path.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

'Declaration
<BrowsableAttribute(False)> _
<PersistenceModeAttribute(PersistenceMode.InnerProperty)> _
<TemplateContainerAttribute(GetType(SiteMapNodeItem))> _
Public Overridable Property PathSeparatorTemplate As ITemplate
<asp:SiteMapPath>
	<PathSeparatorTemplate>ITemplate</PathSeparatorTemplate>
</asp:SiteMapPath>

Property Value

Type: System.Web.UI.ITemplate
An ITemplate object that implements the InstantiateIn method, to render custom content for the path delimiter of a navigation path.

Set the PathSeparatorTemplate to an ITemplate object to use an Image or some other control, such as a Label, as the path delimiter between navigation nodes instead of the PathSeparator string.

If the PathSeparatorTemplate property is set, the template overrides both the PathSeparator text displayed and any PathSeparatorStyle applied to it.

You can declaratively set the PathSeparatorTemplate property to any Web server control, and the ASP.NET infrastructure performs the necessary steps to wrap the Web server control as an ITemplate. However, Web server controls do not implement the ITemplate interface; therefore, when you work with the ITemplate properties programmatically, you must write an ITemplate wrapper for any template code. Then, the PathSeparatorTemplate property is set to an instance of the ITemplate wrapper.

The following code example demonstrates how to define an Image as a PathSeparatorTemplate declaratively in a Web Form.


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


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft