第一步
修改web.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="MicrosoftWebControls" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</configSections>
<MicrosoftWebControls>
<add key="CommonFiles" value="treepath" />
</MicrosoftWebControls>
<system.web>
...................................
第二步,在想使用此控件的页面加入以下语句
<%@ import namespace="Microsoft.Web.UI.WebControls"%>
<%@ register tagprefix = "iecontrols"
namespace="Microsoft.Web.UI.WebControls"
assembly="Microsoft.Web.UI.WebControls"
%>
<iecontrols:treeview id="tvbasic" autoselect="false" shoplus="true" showlines="true" expandlevel="2"
runat="server">
<iecontrols:TreeNode Text="root" Expanded="True">
<iecontrols:TreeNode Text="Node1" Expanded="True">
<iecontrols:TreeNode Text="Node11"></iecontrols:TreeNode>
</iecontrols:TreeNode>
</iecontrols:TreeNode>
</iecontrols:treeview>
第三
将控件的这个属性改为空,(转到设计页面右击控件->属性)SystemImagesPath
第四,
在网站中新建一个treepath目录
将C:/Program Files/IE Web Controls/build/Runtime下的文件拷入其中
第五,
写代码
this.tvbasic.Nodes.Clear();
TreeNode tn=new TreeNode();
tn.Text="nodes level1";
tvbasic.Nodes.Add(tn);
TreeNode tn2=new TreeNode();
tn2.Text="level2";
tvbasic.Nodes.Add(tn2);
TreeNode tn3=new TreeNode();
tn3.Text="level3";
tn.Nodes.Add(tn3);
其它可见
http://www.cnblogs.com/adandelion/archive/2005/09/13/235681.html