* IBM to offer mobile security as a service IBM will start delivering mobile security-as-a-service (MaaS) through its own cloud infrastructure in India, a move that is expected to better address in-country data requirements... IBM Spectrum Computing: IBM has enlarged its portfolio of software-defined infrastructure solutions with cognitive features for workload management.  * LiFi internet technology has been introduced, the new type of wireless internet connection that gives 100 times faster than traditional WiFi -- Invented by Professor Harald Haas from the University of Edinburgh. * Sci. Rachid Yazami has developed a smart chip that charges smartphones in less than 10 minutes. BenQ has launched BlueCore projector - Consumer electronics major BenQ has launched its first BlueCore laser light source projector. For those unaware, devices with BlueCore laser technology have a high contrast output of 80000:1 with an extended lamp life and efficiency. *** 
  Feb 10 2017 8:25AM     Michael Ryan
  1 Comments    5334 Views  
Here Michael Ryan provided a short tutorial with example, about Tree View in Asp.Net C# programming.
Tree View:
The topics in this The topics in this section describe how to work with the ASP.NET TreeView Web control to display hierarchical data (such as a table of contents) in a tree structure in a Web page. 

The TreeView control is made up of TreeNode objects. The TreeView control can be bound to data.
Open Visual Studio and Create New application.
Create a page TreeView.aspx.


Include Web.Sitemap in your project.

Right Click the Project -> Select Add --> Click New Item ->> In the Add New Item PopUp window Select Web.Sitemap and Click OK.


Include the Script file in design page.

<script src="//"></script> 
<script src="//"></script> 


HTML Code:
Copy the HTML code and paste it in your design page.
<!!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">>
<html xmlns="">
<head runat="server">   
    <title>Tree View</title>
    <form id="form1" runat="server">
        <asp:TreeView ID="TreeView1" runat="server" CssClass="TreeView" DataSourceID="SiteMapDataSource1">
        <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" />



Copy the CSS code and paste it in your design page.
<style type="text/css">
            color: #333;
            font-family: sans-serif;
            font-size: 14px;

        .TreeView a,span
            color: #000;
            text-decoration: none;
            font-weight: bold;
            font-size: 14px;

        .TreeView a:hover
            color: #81B411;
            text-decoration: none;
            font-weight: bold;
            font-size: 14px;

        .TreeView span:hover
            color: #81B411;
            text-decoration: none;
            font-weight: bold;
            font-size: 14px;



Create the Sitemap view in web.sitemap.

web.Sitemap Code:

Copy the Xml code and paste it in your web.sitemap file.

<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="" >
  <siteMapNode url="" title="The Developer Tips"  description="My Favorites">
    <siteMapNode title=".Net/ C#/ VB">      
      <siteMapNode title="C# Tutorial" description="C# Tutorial" url="" />

    <siteMapNode title="JavaScript" description="JavaScript">
      <siteMapNode title="JavaScript" description="JavaScript" url="" />
      <siteMapNode title="Ajax" description="Ajax" url="" />      

    <siteMapNode title="jQuery" description="jQuery">
      <siteMapNode title="jQuery" description="jQuery" url="" />
      <siteMapNode title="Ajax" description="Ajax" url="" />

    <siteMapNode title="CSS" description="CSS" url="">     

    <siteMapNode title="HTML5" description="HTML5" url="">

STEP : 8

Execute the application.


I hope this page will helps to learn about Tree view in ASP.Net C#. Thanks.


Adam Fletcher
Nov 11 2018 9:41AM
One can try to know more about how to generate Excel files on C#.

Recent Posts
Create Amazon ElasticCache Using Memcached in CSharp
Oct 29 2018 12:09PM Posted By Amose
Get Google Map Lat Lng (Geo Point) By Pincode in C#
Oct 28 2018 12:09PM Posted By Pranav
Google URL Shortener in C#
Oct 20 2018 12:09PM Posted By Sanjay
Bind Gridview from CSV file in Asp.Net C#
Oct 5 2018 12:09PM Posted By Michael
Call WebService method from jQuery in every 1 minute
Sep 26 2018 12:09PM Posted By John
Gridview custom CSS in ASP.Net
Sep 14 2018 12:09PM Posted By Micheal Ryan
Read excel file and bind to Gridview in C#
Sep 10 2018 12:09PM Posted By Micheal
Follow us on Facebook
Follow us on Google +
Recent post in your Email inbox.
Enter your email address: