我下载了Microsoft.Web.UI.WebControls;想用一下树形控件
在页面文件(tree.aspx)也注册了
<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>下面是设计在显示的HTML文件
<form id="Form1" method="post" runat="server">
<FONT face="宋体">
<iewc:TreeView id="TreeView1" style="Z-INDEX: 101; LEFT: 56px; POSITION: absolute; TOP: 48px" runat="server"
Width="104px" Height="176px">
<iewc:TreeNode Checked="True" Text="中国" Expanded="True">
<iewc:TreeNode Checked="True" Text="北京" Expanded="True"></iewc:TreeNode>
<iewc:TreeNode Checked="True" Text="广东" Expanded="True"></iewc:TreeNode>
<iewc:TreeNode Checked="True" Text="广西" Expanded="True"></iewc:TreeNode>
<iewc:TreeNode Checked="True" Text="湖南" Expanded="True"></iewc:TreeNode>
<iewc:TreeNode Checked="True" Text="湖北" Expanded="True"></iewc:TreeNode>
</iewc:TreeNode>
</iewc:TreeView></FONT>
</form>在运行之后 IE中却没有树形的效果 是一排文字
请问各位高手是什么原因?

解决方案 »

  1.   

    在你的当前项目所在站点的根目录(是当前站点的根目录,不一定是wwwroot目录),将文件夹webctrl_client复制到那个目录下即可。
      

  2.   

    或者你是的工程目录bin下缺少Microsoft.Web.UI.WebControls.dll
      

  3.   

    htc路径错误,或者文件格式(编码)错误
      

  4.   

    http://www.microsoft.com/china/MSDN/library/archives/library/DNAspp/html/aspnet-usingtreeviewieWebcontrol.asp 
    我是按照这个网上说的装的
    没有问 DLL可以引用
    代码中可以用
    TreeNode a=new TreeNode();
        a.Text="资源管理器";
        TreeNode b=new TreeNode();
    b.Text="目录";
    a.Nodes.Add(b);        this.TreeView1.Nodes.Add(new Microsoft.Web.UI.WebControls.TreeNode("aaaaaaaa"));
    this.TreeView1.Nodes.Add(a);
    this.TreeView1.ExpandLevel=1;
      

  5.   

    http://www.microsoft.com/china/MSDN/library/archives/library/DNAspp/html/aspnet-usingtreeviewieWebcontrol.asp
      

  6.   

    确认Inetpub\wwwroot\是否存在目录:
    webctrl_client\1_0
            MultiPage.htc
            TabStrip.htc
            toolbar.htc
            treeview.htc
            webservice.htc
            webserviced.htc
            [images]
            [treeimages]如果不存在这个目录,那么显示的就是流文本。在安装完Internet Explorer Web Controls以后,必须执行以下操作:=====================================
    Internet Explorer Web Controls README
    =====================================
    Last updated: 1/14/2002Thank you for downloading the IE Web Controls source code release!  The Src 
    folder contains the source code for the IE MultiPage, ToolBar, TreeView, and 
    TabStrip controls, along with related base classes and design-time support.To build the IE Web Controls:1.  Make sure you have installed the .NET Framework SDK v1.0 or v1.1
    2.  Run Build.bat, which will create a build folder in this directory.  
        The build folder contains Microsoft.Web.UI.WebControls.dll and a 
        Runtime directory of supporting files.To run the IE Web Controls:1.  Copy the contents of the Runtime directory to the webctrl_client\1_0
        directory under your top-level site directory.  For example, if your 
        site root is c:\Inetpub\wwwroot, type this at the command prompt:    xcopy /s /i .\build\Runtime c:\Inetpub\wwwroot\webctrl_client\1_0 /y    This will create the following directory structure under the site:      /webctrl_client/1_0
            MultiPage.htc
            TabStrip.htc
            toolbar.htc
            treeview.htc
            webservice.htc
            webserviced.htc
            [images]
            [treeimages]2.  Create a new web application in IIS and copy the contents of the
        samples directory to this application directory.  For example:    xcopy /s /i .\samples c:\Inetpub\wwwroot\sampleapp /y3.  Create a /bin subdirectory for the application and copy the file
        Microsoft.Web.UI.WebControls.dll to this directory.    The contents of the application will be as follows:      /sampleapp
            multipage.aspx
            state_city.xml
            tabstrip.aspx
            toolbar.aspx
            treeview.aspx
            treeview_bound.aspx
            /bin
              Microsoft.Web.UI.WebControls.dll4.  Request the sample pages from your Internet Explorer web browser, for
        example: http://localhost/sampleapp/multipage.aspx
        
    For additional documentation and samples visit:
    http://msdn.microsoft.com/library/default.asp?url=/workshop/webcontrols/webcontrols_entry.asp
      

  7.   

    操作步骤:
    1 运行IEwebcontrol.exe,比如安装在 C:\Program Files\IE Web Controls
    2 执行 C:\Program Files\IE Web Controls 下 build.bat
    3 运行/cmd ,  cd C:\Program Files\IE Web Controls 
    4 xcopy /s /i .\samples c:\Inetpub\wwwroot\sampleapp /y
    5 xcopy /s /i .\build\Runtime c:\Inetpub\wwwroot\webctrl_client\1_0 /y
      OK搞定