SiteMapPath Path separator template in asp.net

SiteMapPath PathSeparatorTemplate
The following asp.net c# example code demonstrate us how can we use PathSeparatorTemplate in SiteMapPath control. SiteMapPath is an asp.net navigation web server control. SiteMapPath display a navigation path/breadcrumb/eyebrow that shows the users current page location and displays links as a path back to the home page. SiteMapPath control render a navigation from site map data.

PathSeparatorTemplate get or set a control template to use for the path delimiter of a site navigation path. We can use an image or a label control as SiteMapPath items separator. Path separator template allow us to fully customize the path separator. We also can use both image and text as path separator while we write code for path separator template.
ButtonExample.aspx
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>How to use path separator template in SiteMapPath, PathSeparatorTemplate</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h2 style="color:Navy">SiteMapPath Example: PathSeparatorTemplate</h2>
        <asp:SiteMapPath 
             ID="SiteMapPath1" 
             runat="server"
             ForeColor="BurlyWood"
             Font-Size="Large"
             Font-Bold="true"
             BorderWidth="1"
             BorderColor="Wheat"
             >
             <PathSeparatorTemplate>
                ||
             </PathSeparatorTemplate>
             <NodeStyle ForeColor="BurlyWood" />
        </asp:SiteMapPath>
    </div>
    </form>
</body>
</html>
Web.sitemap
Web.sitemap source code here.

   



Related asp.net examples