ASP.NET Code
  Home arrow ASP.NET Code arrow Page 2 - Directory Tree Browser
Iron Speed
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
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 CODE

Directory Tree Browser
By: Andrew_Putnam
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 85
    2003-06-28

    Table of Contents:
  • Directory Tree Browser
  • Getting Started
  • The Recursion

  • 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
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Directory Tree Browser - Getting Started
    (Page 2 of 3 )

    The tree.aspx page is our output page of the directory tree. This can be used in several ways, including as a popup page. In the example I have the tree as part of a form, however the form action is set to '#', so it does not redirect anywhere. The radio buttons that are created have a name of "np" that can be retreived using standard form processing. The values for the "np" radio buttons are set to the URL path to the folder that is selected. In the example, when you select one of the radio buttons, a Javascript message box will pop up showing you the value of the radio selected.

    tree.aspx

     <%@ Page Inherits="DirTree" src="tree.vb" %>
    <
    SCRIPT language=vb runat="server">
        
    sub page_load

            
    '-- Load the directory tree
            TreeList.Text = buildTree() 
        end sub
    </SCRIPT>

    <SCRIPT language=javascript>

    <!--
        // preload images
        if (document.images) {
            plus_on = new Image ();
            plus_on.src = '
    plus.gif';
            plus_off = new Image ();
            plus_off.src = '
    minus.gif';
            fold_on = new Image ();
            fold_on.src = '
    fld_close.gif';
            fold_off = new Image ();
            fold_off.src = '
    fld_open.gif';
        }


        // shows or hides folder tree items
        function showHide(dID, iID, fID) {
            if (dID.style.display=='
    none') { 
                if (document.images) {
                    document.images[iID].src = eval('
    plus_off.src');
                    document.images[fID].src = eval('
    fold_off.src');
                }
                dID.style.display = '';
            } else { 
                if (document.images) {
                    document.images[iID].src = eval('
    plus_on.src');
                    document.images[fID].src = eval('
    fold_on.src');
                }
                dID.style.display = '
    none';
            } 
        }

        // alert message on radio selection
        function unlockSubmit(fPath) {
            var aMsg='
    If this were an actual form the valuen';         aMsg+='passed for this selection would be :nn';
            aMsg+=fPath
            alert(aMsg);
        } 

    //-->
    </SCRIPT>

    <STYLE>
    <!--
    .main
    {
        color : #000000;
        background-color : #FFFFFF;
        font-family : Verdana, Tahoma, Arial, Helevetica, Sans-Serif;
        font-size : 8.5pt;
        cursor : default;
        font-weight : normal;
    }
    //-->
    </STYLE>

    <FORM name=doNothing action=# method=post>
    <DIV class=main><?xml:namespace prefix = asp /><asp:Literal id=TreeList Runat="server"></asp:Literal></DIV></FORM>

    More ASP.NET Code Articles
    More By Andrew_Putnam


     

    ASP.NET CODE ARTICLES

    - How to Use the ListBox Control in ASP.NET 2.0
    - How to Load XML Documents in ASP.NET 2.0
    - DataGrid Code
    - ASP.NET Guestbook
    - User Controls and Client Side Scripting
    - ASP.NET Programming with Microsoft's AS...
    - ASP.NET Basics (part 3): Hard Choices
    - ASP.NET Basics (part 2): Not My Type
    - ASP.NET Basics (part 1): Nothing But .Net
    - Directory Tree Browser
    - How to get the confirmation of Yes/No from a...
    - Complete example using custom errors and wri...
    - Paging Certain # records per page .NET style
    - General Methods of formatting and Subtractin...
    - .NET LinkButton web control

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway