I want to use one
TreeView
Controls to display the structure of the folder,
ASP
.NET
There is no default
TreeView
Control, so I found relevant information, I know that Microsoft released its controls.
IEWebControls.
I downloaded the control and installed on my machine.
1, download:
Download URL
Http://msdn.microsoft.com/downloads/sample/internet/asp_dot_net_serverControls/webControls/
2, install:
First, decompress then run Builder.bat. Found an error, check it, it was csc.exe found. So, I have modified the batch, add the full path to this file in front of CSC.exe, the content of the batch becomes:
@IF "% _echo%" == "" echo off
IF not exist building mkdir build
C: /Windows/Microsoft.Net/framework/v1.1.4322/csc.exe /out:build/microsoft.web.ui.webcontrols.dll @ ieWebControls.RSP
Xcopy SRC / Runtime Build / Runtime / E / Y / I / Q
Then, according to the readme prompt, create a folder C: / INETPUB / WWWWROOT / WebCtrl_Client in the default site, and then create the "/ 1_0" folder under this folder, then copy the files in the builder directory. Under this folder, this folder contains the following files:
/ WebCtrl_Client / 1_0
Multipage.htc
Tabstrip.htc
Toolbar.htc
TreeView.htc
Webservice.htc
WebServiced.htc
[images]
[TreeImages]
Then, copy the generated DLL file (Microsoft.Web. WebControls.dll) to the bin directory under your newly created web application.
3, use
According to the example file provided, create a web application, open the page you want to edit, add the following sentence on the top:
<% @ Register tagprefix = "IE" namespace = "microsoft.web.ui.webcontrols" assembly = "Microsoft.Web.ui.WebControls"%>
Put this control in your proper position:
Alternatively, by "Adding / Removing" on the toolbox, dragging the control box to the appropriate location.
4, increase node
If you need to write a fixed node, you can modify the "NODES" property in the properties of the control to create a tree structure.
If it is dynamically generated, you must modify the CS code file. The step is about the following:
a, add a reference
b, define TreeView:
Protected Microsoft.Web.ui.WebControls.treeView TreeView1;
c, generate nodes:
Microsoft.Web.ui.WebControls.treenode filenode1 = new microsoft.Web.ui.WebControls.treenode (); D, set node properties
Filenode1.text = "root node";
Filenode1.target = "http://www.9cbs.net";
E, join the node to TreeView
TreeView1.nodes.add (filenode1);