ASP.NET
  Home arrow ASP.NET arrow Page 2 - TreeView Navigation in ASP.Net 2.0
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

TreeView Navigation in ASP.Net 2.0
By: Caroline Bogart
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 26
    2006-06-06

    Table of Contents:
  • TreeView Navigation in ASP.Net 2.0
  • TreeView Declarative Binding
  • Declaring the TreeView Nodes
  • Treeview DataSource Binding
  • Binding to a SiteMapDataSource

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    TreeView Navigation in ASP.Net 2.0 - TreeView Declarative Binding


    (Page 2 of 5 )

    If your web site is relatively small and stable then it’s probably safe to declaratively populate the TreeView. Use the declarative method if the menu is not likely to ever change. The navigation nodes will be placed directly inside the TreeView declaration. Figure 2 shows the minimum code required to create a TreeView. We’ll define the nodes where the figure says “[menu items are declared here]”:

    The TreeView declaration itself is pretty simple: the ID and runat are required tags for any web control.

    Node Types

    The TreeView menu has three node types: Root, Parent and Leaf.

    Root nodes have null parent nodes. Shelters and Humane Societiesare root nodes.

    Parent nodes have a parent and a child. Local is a parent node.

    Leaf nodes have a parent but not a child: Municipal, Private, Mixed, Private and Public are leaf nodes.

    To illustrate the differences, let’s color the Root blue, the Parent black and the Leaf red.

    Figure 4 shows the Root, Parent and Leaf colored variations.

    Figure 4 Root, Parent and Leaf Illustration

    More ASP.NET Articles
    More By Caroline Bogart


       · Hi all, I'm Caroline, the author of this TreeView article. Did the article help?...
       · Thanks for the article, this helps, I have following questions:1. When I used...
       · >>>Thanks for the article, this helps, I have following questions:You're very...
       · Hi Caroline, yes your article was very helpful, especially the getting rid of ROOT...
       · I'm not completely sure I follow because if I read you write you could concatenate...
       · I have been trying to build the treeview control dynamically, not binding it to a...
       · Could you please explain on the seo aspect of using treeview controls. The code...
       · Hi, This article is best and useful one. Explanations are easy to...
     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek