SiteMapPath.PathDirection Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the order that the navigation path nodes are rendered in.

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

public virtual PathDirection PathDirection { get; set; }
/** @property */
public PathDirection get_PathDirection ()

/** @property */
public void set_PathDirection (PathDirection value)

public function get PathDirection () : PathDirection

public function set PathDirection (value : PathDirection)

Property Value

A PathDirection that indicates the hierarchical order that navigation nodes are rendered in. The default is RootToCurrent, which indicates that the nodes are rendered in hierarchical order from the top-most node to the current node, from left to right.

Exception typeCondition

ArgumentOutOfRangeException

The value for PathDirection is not one of the base PathDirection enumerations.

Set PathDirection to RootToCurrent if you want to display the navigation path from left to right; the navigation path appears as a progression from left to right of site map nodes. In other words, the root node is at the leftmost position, each subsequent node is in the next position to the right, and the current node is in the rightmost position.

Set PathDirection to CurrentToRoot if you want to display the navigation path from right to left. In other words, the node order is reversed so that the root node displays at the rightmost position and the current node displays at the leftmost position. While not as common, this ordering can be used for localizing Web Forms pages and the SiteMapPath control for languages that read from right to left.

The value of this property is stored in view state.

The following code example demonstrates how to declaratively set the PathDirection property of a SiteMapPath in a Web Forms page.

<%@ Page language="c#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<HTML>
    <HEAD>
        <title>Catalog</title>
    </HEAD>
    <body MS_POSITIONING="FlowLayout">
        <form id="Form1" method="post" runat="server">
            <p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
                    RootNodeStyle-Font-Bold="true"
                    RootNodeStyle-Font-Names="Arial Black"
                    RootNodeStyle-Font-Italic="True"
                    RootNodeStyle-ForeColor="Green"
                    CurrentNodeStyle-ForeColor="Orange"
                    PathSeparator="<::>"
                    PathDirection="CurrentToRoot"
                    CurrentNodeAsLink="false"
                    ShowToolTips="false"/></p>
        </form>
    </body>
</HTML>

<%@ Page Language="VJ#"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<HTML>
    <HEAD>
        <title>Catalog</title>
    </HEAD>
    <body MS_POSITIONING="FlowLayout">
        <form id="Form1" method="post" runat="server">
            <p><asp:SiteMapPath runat="server" ID="SiteMapPath1"
                    RootNodeStyle-Font-Bold="true"
                    RootNodeStyle-Font-Names="Arial Black"
                    RootNodeStyle-Font-Italic="True"
                    RootNodeStyle-ForeColor="Green"
                    CurrentNodeStyle-ForeColor="Orange"
                    PathSeparator="<::>"
                    PathDirection="CurrentToRoot"
                    CurrentNodeAsLink="false"
                    ShowToolTips="false"/></p>
        </form>
    </body>
</HTML>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0
Show: