This tutorial will show you how to work with TreeView control to display folders and file names without refreshing web page by VB.NET and ASP.NET 2.0.
First, you need to import the namespace from System.IO.DirectoryInfo in the namespace System.IO.DirectoryInfo class for typical operations such as copying, moving, renaming, creating, and deleting directories.

We will use the Treeview control to display the files names and folders without refreshing web page. The TreeView is an ASP.NET server control for authoring user interfaces representing hierarchical data. In the sample, we will use the events of Treeview1_TreeNodePopulate and LoadChildNode to show you how it works. Treeview1_TreeNodePopulate is used for displaying the folders and files in drive C. LoadChildNode is used for loading the name of folder and file. The code as below:

The front end TreeViewVB2005.aspx page looks something like this:

The flow for the code behind page is as follows

Download Source Files