Building Some Web TreeViews

Cross posting from my blog ( Building Some Web TreeViews )

The TreeView control in ASP.NET 2.0 is used to display hierarchical data, such as table of contents or file directory in a tree structure. In most applications that I do, I use the TreeView control to show file directory structure. I was able to create a class that populates a TreeView provided with a physical directory structure residing on the same computer as to where the server is running. Rename the file below to .dll and use it as a reference on your web application. Once added to your web application usage would be:

By default, the variable location will treat the path as a virtual path. If you want to specify a specific physical directory, you can specify the 8 character directory format as a location value but you need to specify the property “isWeb” as “false” and as shown above. The “TreeView1″ is assumed to be a TreeView control placed onto the ASPX file. For testing purposes, you can put in your code behind the following code without placing a TreeView control in your ASPX file but will output the same.

Physical Drive TreeView DLL

The challenge for me is to bring the same functionality to a SourceSafe database which is despite having a directory like structure isn’t directory based at all when accessed programmatically. Furthermore, the DLL provided with Visual Source Safe 2005 isn’t a native .NET object but a COM interop one.

Luckily, using the same logic behind the previous DLL, I managed to create a DLL to populate a TreeView from a SourceSafe database. The constructor needs only 3 parameters namely the database location, username, and password.

Sample usage would be:

Same with the code above, the code assumes that there’s a TreeView control instance in the ASPX file that has an ID of “TreeView1″.

Sourcesafe TreeView

For questions, feel free to add some comments
Published Wednesday, April 23, 2008 3:01 PM by pornstar
Filed under: ,

Comments

# what isweb 2 0

Saturday, May 31, 2008 7:49 PM by what isweb 2 0

Pingback from  what isweb 2 0

# reference dll in virtual directory

Friday, August 01, 2008 8:46 PM by reference dll in virtual directory

Pingback from  reference dll in virtual directory

Powered by Community Server (Commercial Edition), by Telligent Systems