當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET SiteMapNodeCollection構造函數代碼示例

本文整理匯總了VB.NET中System.Web.SiteMapNodeCollection.SiteMapNodeCollection構造函數的典型用法代碼示例。如果您正苦於以下問題:VB.NET SiteMapNodeCollection構造函數的具體用法?VB.NET SiteMapNodeCollection怎麽用?VB.NET SiteMapNodeCollection使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。您也可以進一步了解該構造函數所在System.Web.SiteMapNodeCollection的用法示例。


在下文中一共展示了SiteMapNodeCollection構造函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。

示例1: LoadSiteMapData

' The LoadSiteMapData() Function loads site navigation
' data from persistent storage into a DataTable.

Dim siteMapData As DataTable
siteMapData = LoadSiteMapData()

' Create a SiteMapNodeCollection.
Dim nodes As New SiteMapNodeCollection()

' Create a SiteMapNode and add it to the collection.
Dim tempNode As SiteMapNode
Dim row As DataRow
Dim index As Integer
index = 0

While (index < siteMapData.Rows.Count)

    row = siteMapData.Rows(index)

    ' Create a node based on the data in the DataRow.
    tempNode = New SiteMapNode(SiteMap.Provider, row("Key").ToString(), row("Url").ToString())

    ' Add the node to the collection.
    nodes.Add(tempNode)
    index = index + 1
End While
開發者ID:VB.NET開發者,項目名稱:System.Web,代碼行數:26,代碼來源:SiteMapNodeCollection

示例2: SiteMapNodeCollection

' Create a SiteMapNodeCollection with all the nodes
' from the first two hierarchical levels of the current
' site map.
Dim baseCollection As SiteMapNodeCollection
baseCollection = New SiteMapNodeCollection(SiteMap.RootNode)

Dim childCollection As SiteMapNodeCollection = SiteMap.RootNode.ChildNodes

baseCollection.AddRange(childCollection)

Response.Write( "<BR>Derived SiteMapNodeCollection.<BR><HR><BR>")

For Each node In baseCollection
    Response.Write( node.Title + "<BR>")
Next
開發者ID:VB.NET開發者,項目名稱:System.Web,代碼行數:15,代碼來源:SiteMapNodeCollection

示例3: SiteMapNodeCollection

Dim siteNodes As SiteMapNodeCollection
siteNodes = SiteMap.RootNode.GetAllNodes()

If siteNodes.IsReadOnly Or siteNodes.IsFixedSize Then

    Response.Write("Collection is read-only or has fixed size.<BR>")

    ' Create a new, modifiable collection from the existing one.
    Dim modifiableCollection As SiteMapNodeCollection
    modifiableCollection = New SiteMapNodeCollection(siteNodes)

    ' The MoveNode example method moves a node from position one to
    ' the last position in the collection.
    MoveNode(modifiableCollection)
Else
    MoveNode(siteNodes)
End If
開發者ID:VB.NET開發者,項目名稱:System.Web,代碼行數:17,代碼來源:SiteMapNodeCollection


注:本文中的System.Web.SiteMapNodeCollection.SiteMapNodeCollection構造函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。