SiteMapNodeItemType 열거형

정의

SiteMapNodeItemType 열거형은 노드 계층 구조 안에서 SiteMapPath 노드의 유형을 식별하기 위해 SiteMapNodeItem 컨트롤에서 사용됩니다.

public enum class SiteMapNodeItemType
public enum SiteMapNodeItemType
type SiteMapNodeItemType = 
Public Enum SiteMapNodeItemType
상속
SiteMapNodeItemType

필드

Current 2

사이트 탐색 경로에서 현재 표시된 페이지입니다.

Parent 1

사이트 탐색 경로에서 현재 표시된 페이지의 부모 노드입니다. 부모 노드는 탐색 계층 구조에서 루트 노드와 현재 노드 사이에 있는 모든 노드입니다.

PathSeparator 3

사이트 맵 탐색 경로 구분 기호입니다. SiteMapPath 컨트롤에 대한 기본값 구분 기호는 ">" 문자입니다.

Root 0

사이트 탐색 계층 구조의 최상위 노드입니다. 루트 노드는 하나만 있을 수 있습니다.

예제

다음 예제에서는 메서드 내에서 를 만든 후 메서드를 호출 SiteMapPath.OnItemCreated 하는 SiteMapNodeItem 방법을 보여 줍니다 SiteMapPath.InitializeItem . 이 예제는에 대해 제공 된 큰 예제의 일부는 SiteMapPath 클래스입니다.

private void AddDropDownListAfterCurrentNode(SiteMapNodeItem item) {

    SiteMapNodeCollection childNodes = item.SiteMapNode.ChildNodes;

    // Only do this work if there are child nodes.
    if (childNodes != null) {

        // Add another PathSeparator after the CurrentNode.
        SiteMapNodeItem finalSeparator =
            new SiteMapNodeItem(item.ItemIndex,
                                SiteMapNodeItemType.PathSeparator);

        SiteMapNodeItemEventArgs eventArgs =
            new SiteMapNodeItemEventArgs(finalSeparator);

        InitializeItem(finalSeparator);
        // Call OnItemCreated every time a SiteMapNodeItem is
        // created and initialized.
        OnItemCreated(eventArgs);

        // The pathSeparator does not bind to any SiteMapNode, so
        // do not call DataBind on the SiteMapNodeItem.
        item.Controls.Add(finalSeparator);

        // Create a DropDownList and populate it with the children of the
        // CurrentNode. There are no styles or templates that are applied
        // to the DropDownList control. If OnSelectedIndexChanged is raised,
        // the event handler redirects to the page selected.
        // The CurrentNode has child nodes.
        DropDownList ddList = new DropDownList();
        ddList.AutoPostBack = true;

        ddList.SelectedIndexChanged += new EventHandler(this.DropDownNavPathEventHandler);

        // Add a ListItem to the DropDownList for every node in the
        // SiteMapNodes collection.
        foreach (SiteMapNode node in childNodes) {
            ddList.Items.Add(new ListItem(node.Title, node.Url));
        }

        item.Controls.Add(ddList);
    }
}
Private Sub AddDropDownListAfterCurrentNode(item As SiteMapNodeItem)

   Dim childNodes As SiteMapNodeCollection = item.SiteMapNode.ChildNodes

   ' Only do this work if there are child nodes.
   If Not (childNodes Is Nothing) Then

      ' Add another PathSeparator after the CurrentNode.
      Dim finalSeparator As New SiteMapNodeItem(item.ItemIndex, SiteMapNodeItemType.PathSeparator)

      Dim eventArgs As New SiteMapNodeItemEventArgs(finalSeparator)

      InitializeItem(finalSeparator)
      ' Call OnItemCreated every time a SiteMapNodeItem is
      ' created and initialized.
      OnItemCreated(eventArgs)

      ' The pathSeparator does not bind to any SiteMapNode, so
      ' do not call DataBind on the SiteMapNodeItem.
      item.Controls.Add(finalSeparator)

      ' Create a DropDownList and populate it with the children of the
      ' CurrentNode. There are no styles or templates that are applied
      ' to the DropDownList control. If OnSelectedIndexChanged is raised,
      ' the event handler redirects to the page selected.
      ' The CurrentNode has child nodes.
      Dim ddList As New DropDownList()
      ddList.AutoPostBack = True

      AddHandler ddList.SelectedIndexChanged, AddressOf Me.DropDownNavPathEventHandler

      ' Add a ListItem to the DropDownList for every node in the
      ' SiteMapNodes collection.
      Dim node As SiteMapNode
      For Each node In  childNodes
         ddList.Items.Add(New ListItem(node.Title, node.Url))
      Next node

      item.Controls.Add(ddList)
   End If
End Sub

설명

합니다 SiteMapPath 컨트롤의 컬렉션으로 사이트 탐색 정보 관리 SiteMapNodeItem 개체입니다. SiteMapNodeItem 개체가 나타내는 기능적으로 서로 다른 유형의 SiteMapNode 노드. 따라서에서 관리 되는 SiteMapPath 컨트롤입니다. 다음 목록에는 사용할 수 있는 노드의 유형을 설명합니다.

  • 현재 표시 된 페이지를 나타내는 하나의 노드.

  • 사이트 탐색 계층의 최상위 노드는 하나의 노드.

  • 최상위 노드 및 현재 노드 (부모 노드) 간에 0 개 이상의 노드.

  • 사이트 탐색 경로 구분 기호를 나타내는 0 개 이상의 노드.

각 노드는 데이터 바인딩된 기본 SiteMapNode, PathSeparator 형식의 노드를 제외 하 고 있습니다.

적용 대상

추가 정보