Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6945723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:28:22+00:00 2026-05-27T13:28:22+00:00

I am looking for a control or a sample project to browse files and

  • 0

I am looking for a control or a sample project to browse files and folders of a defined folder recursively with asp.net using treeview.

I dont know if there is such as a free control/sample project like this?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:28:22+00:00Added an answer on May 27, 2026 at 1:28 pm

    See my article – Build a File tree explorer with asp.net and jquery. The original jquery file is no longer available at the source i specified in the article. However i have the jquery file and can make it available.

    Edit: I will post code in a bit.

    Code is below:

    First you’ll need server code to access the file system. This is can go inside a code behind file or in the aspx page itself – just delete everything else.

     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim dir As String
        If Request.Form("dir") Is Nothing Or Request.Form("dir").Length <= 0 Then
            dir = "/"
        Else
            dir = Request.Form("dir")
        End If
        Dim di As New System.IO.DirectoryInfo(Server.MapPath(dir))
        Dim sb As New StringBuilder
        sb.Append("<ul class=""jqueryFileTree"" style=""display: none;"">" & ControlChars.Lf)
        Dim di_child As System.IO.DirectoryInfo
        For Each di_child In di.GetDirectories()
            sb.Append((ControlChars.Tab & "<li class=""directory collapsed""><a href=""#"" rel=""" & dir & di_child.Name & "/"">" & di_child.Name & "</a></li>" & ControlChars.Lf))
        Next di_child
        Dim fi As System.IO.FileInfo
        For Each fi In di.GetFiles()
            Dim ext As String = ""
            If fi.Extension.Length > 1 Then
                ext = fi.Extension.Substring(1).ToLower()
            End If
    
            sb.Append((ControlChars.Tab & "<li class=""file ext_" & ext & """><a href=""#"" rel=""" & dir & fi.Name & """>" & fi.Name & "</a></li>" & ControlChars.Lf))
        Next fi
        sb.Append("</ul>")
        Response.Write(sb.ToString)
    End Sub
    

    Next you’ll need a page to show the file tree. This page needs to reference the jquery core file and the jquery file tree script. I happen to have a reference to the jquery core file in my master page.

    <link href="../styles/jqueryFileTree.css" rel="stylesheet" type="text/css" />
    <script src="../scripts/jqueryFileTree.js" type="text/javascript"></script>
    

    In the page that shows the file tree, stick this code. Root is the directory to browse, filetree.aspx has the serve code above. The div becomes the file tree. For the demo i use an iframe to act as the file viewer.

    <script type="text/javascript">
        var $j = jQuery.noConflict();
        $j(document).ready(function () {
            $j('#divFileTree').fileTree({
                root: '/demos/',
                script: 'filetree.aspx',
                expandSpeed: 1000,
                collapseSpeed: 1000,
                multiFolder: false
            }, function (file) {
                alert(file);
                $j('#demoviewer').attr('src', file);
            });
        });
    
    
    </script>
    <div id="divFileTree"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a simple mp3 control, my project is an ASP.NET web site
I'm looking at this control, and it seems to be lacking the standard .net
I have an ASP.NET project that uses XML Serialization for the main operation for
This is my first attempt to build an ASP.NET server control. Writing the control
I've got a .Net project where we're using an ActiveRecords scaffolding interface for simple
I'm looking for a simple protocol to control remote processes from one managing application.
In any language really, im looking for a simple (very simple) way to control
Im looking for a control like the DataForm which is new in Silverlight 3
I'm looking for a control that the Visual Studio Toolbox menu uses. It can
I am looking for a control which can show me selected image detail view

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.