Results 1 to 5 of 5

Thread: create tree structure in asp

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    4

    Question

    How can I create a tree structure in asp useing a recursive function.
    Ex. Database with three fields: ID, Parent_Id, Name

    1 0 NFL
    2 0 NBA
    3 1 AFC
    4 1 NFC
    5 3 East
    6 3 West
    7 4 East
    8 4 West
    9 2 East
    10 2 West

    Output on Page in links.

    NFL
    - AFC
    - East
    - West
    - NFC
    - East
    - West
    NBA
    - East
    - West

    The code should be dynamic and allow for any number of parent/child levels.

    Thanks,
    Kevin

  2. #2
    Addicted Member tonyenkiducx's Avatar
    Join Date
    Oct 2000
    Location
    London England
    Posts
    147
    Unfortunately making an infinate tree structure in ASP is not as easy as it might sound, I had to do it once with a dhtml dropdown menu system. The only way to do it, is to define a function that draws a sub menu, then make a call on it, have the function itself check if it needs to draw a sub function, then call itself again. But bewarned, vb and asp do not thread well, and I dunno what affect it might have on server performance(I decided on a fixed 99branch length tree for my dhtml solution)

  3. #3
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    i have made code for a treeview in jscript.
    i don't know where it is but i will try to find it and make a new one for asp

    does it have to run off a database?

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    4

    asp tree

    Thanks for replying to my query about an asp tree.
    Yes, it will be using a database. The result is to create
    a left navigation of links with tree structure hierarchy.

  5. #5
    Lively Member
    Join Date
    Feb 2001
    Posts
    87
    I think this will be useful for you : CodeCharge software. It has an example of how to make trees using ASP, ASP Templates. It's really cool. Check it out.

    http://www.codecharge.com

    There is a trial download for it. Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width