ASP Net Controls ASP.Net Tutorial

<%@ page language="C#" %>
<%@ import namespace="System.IO" %>

void TreeView1_TreeNodePopulate(object sender, System.Web.UI.WebControls.TreeNodeEventArgs e)
{
    if (e.Node.ChildNodes.Count == 0) {    
        this.LoadChildNodes(e.Node);
    }
}    
    
private void LoadChildNodes(TreeNode node) {    
    DirectoryInfo directory;
    if (node.ValuePath.Length == 0) {
        directory = new DirectoryInfo(node.Value);
    } else {
        directory = new DirectoryInfo(node.ValuePath);
    }
    foreach(DirectoryInfo subDirectory in directory.GetDirectories()) {
        TreeNode subNode = new TreeNode(subDirectory.Name);
        subNode.PopulateOnDemand = true;
        subNode.SelectAction = TreeNodeSelectAction.SelectExpand;
        node.ChildNodes.Add(subNode);
    }
}



    Untitled Page


    
                              runat="server" 
                      font-underline="False" 
                      font-names="Tahoma"
                      font-size="8pt" 
                      font-italic="False" 
                      font-bold="False" 
                      imageset="XP_Explorer"
                      forecolor="Black" 
                      nodeindent="15" 
                      ontreenodepopulate="TreeView1_TreeNodePopulate">
                                           font-underline="False" 
                               font-italic="False"
                               font-bold="False">
            
                                        font-underline="True" 
                            font-italic="False" 
                            font-bold="False">
            
            
            
            
            
            
                                              value="c:\" 
                              populateondemand="True" 
                              showcheckbox="False"
                              selectaction="SelectExpand" 
                              selected="True" 
                              text="Drive C:\">
                
            

                                   verticalpadding="2" 
                       horizontalpadding="2" 
                       font-underline="False"
                       font-names="Tahoma" 
                       font-size="8pt" 
                       font-italic="False" 
                       font-bold="False">