Looping through Nested Category Collections

Recursively looping through category collection with a sub category collection.

Dim cl As New CategoryList
cl = Category.GetChildCategories(1)

Dim As New Category
Dim cc As New Category

For Each In cl
    GetChildren(c)
Next

Function GetChildren(ByVal As Category) As String

    
Response.Write(c.Name & "<BR>")        

    
Dim cc As New Category

    
If c.ChildCategories.Count > 0 Then
        For Each 
cc In c.ChildCategories
            GetChildren(cc)
        
Next
    End If

End Function

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
Print | posted on Wednesday, November 09, 2005 8:17 PM

Feedback

No comments posted yet.
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: