PathDirection 枚举

定义

指示为网站导航控件呈现导航节点的层次结构顺序。Indicates the hierarchical order in which navigation nodes are rendered for site-navigation controls.

public enum class PathDirection
public enum PathDirection
type PathDirection = 
Public Enum PathDirection
继承
PathDirection

字段

CurrentToRoot 1

以从当前节点到最顶层节点的层次结构顺序,从左到右地呈现节点。Nodes are rendered in a hierarchical order from the current node to the top-most node, from left to right.

RootToCurrent 0

以从最顶层节点到当前节点的层次结构顺序,从左到右地呈现节点。Nodes are rendered in a hierarchical order from the top-most node to the current node, from left to right.

示例

下面的代码示例演示如何PathDirection SiteMapPath在 Web 窗体页中以声明方式设置的属性。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 xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        <title>Catalog</title>
    </head>
    <body>
        <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"
                    RenderCurrentNodeAsLink="false"
                    ShowToolTips="false"/></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>
        <title>Catalog</title>
    </head>
    <body>
        <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"
                    RenderCurrentNodeAsLink="false"
                    ShowToolTips="false"/></p>
        </form>
    </body>
</html>

注解

控件使用SiteMapPath枚举来指定用于呈现站点地图节点的顺序。 PathDirectionThe PathDirection enumeration is used by the SiteMapPath control to specify the ordering used to render site map nodes. 如果该PathDirection属性设置为 RootToCurrent, 则导航路径将按最常见的方式显示, 从最常见的节点到当前节点, 从左到右。If the PathDirection property is set to RootToCurrent, the navigation path is displayed in the most common way, from the top-most node to the current node, from left to right. PathDirection如果设置为 CurrentToRoot, 则从当前节点到最顶层节点 (从左向右) 显示导航路径。If the PathDirection is set to CurrentToRoot, the navigation path is displayed from the current node to the top-most node, from left to right.

适用于

另请参阅