>>>>File or assembly name Microsoft.Web.UI.WebControls, or one of its dependencies, was not founddid you install it in the GAC? how did you use it? show some code, or try<%@ import namespace="Microsoft.Web.UI.WebControls" %>
<%@ Register TagPrefix="mytree" 
Namespace="Microsoft.Web.UI.WebControls" 
Assembly="Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>

解决方案 »

  1.   

    saucer(思归) 大俠:
        是安裝在gac中啊,並且我也有你上面寫的那些代碼,下面我將所有的代碼貼出來,
    using System;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using Microsoft.Web.UI.WebControls;
    using PCI.Component;namespace PCI.Reports.MatControl
    {
    /// <summary>
    /// MatOdr1TreeView 的摘要描述。
    /// </summary>
    public class MatOdr1TreeView : System.Web.UI.Page
    {
    string comp="";
    bool com=false;
    myOraDataConn myOraConn=new myOraDataConn();
    protected Microsoft.Web.UI.WebControls.TreeView TreeView1;
    DataTable dt;
    private void Page_Load(object sender, System.EventArgs e)
    {
    // 將使用者程式碼置於此以初始化網頁
    if(!IsPostBack)
    {
    dt=new DataTable();
    dt=myOraConn.GetTable("select style_no,art_no from artm order by style_no,art_no");
    for(int i=0;i<dt.Rows.Count;i++)
    {   
    if(dt.Rows[i][0].ToString()!=comp)
    {
                         comp=dt.Rows[i][0].ToString();
     com=true;
     InitTree(TreeView1.Nodes,dt.Rows[i][0].ToString());
    }
    }
               } } private void InitTree(TreeNodeCollection Nds,string parentId)
    {
    DataView dv=new DataView();
    TreeNode tmpNd=new TreeNode();
    dv.Table=dt;
    tmpNd.Text=parentId;
    if(com==true)
    {
    //     tmpNd.ImageUrl="../../img/atb_calendar.gif";
    tmpNd.NavigateUrl="";
    }
    else
    {
    // tmpNd.ImageUrl="../../img/sort.gif";
    tmpNd.NavigateUrl="MatOdr1.aspx?styleno="+comp+"&artno="+parentId;
    tmpNd.Target="right";
    }
    Nds.Add(tmpNd);            if(com==true)
    {
    com=false;
    dv.RowFilter="style_no='"+parentId+"'";
    foreach(DataRowView drv in dv)
    {
    InitTree(tmpNd.Nodes,drv["art_no"].ToString());
    }
    }
    } #region Web Form Designer generated code
    override protected void OnInit(EventArgs e)
    {
    //
    // CODEGEN: 此呼叫為 ASP.NET Web Form 設計工具的必要項。
    //
    InitializeComponent();
    base.OnInit(e);
    }

    /// <summary>
    /// 此為設計工具支援所必需的方法 - 請勿使用程式碼編輯器修改
    /// 這個方法的內容。
    /// </summary>
    private void InitializeComponent()
    {    
    this.Load += new System.EventHandler(this.Page_Load); }
    #endregion
    }
    }
      

  2.   

    are you sure you have the control on the web server?on your web server, open a dos window and rungacutil -lmake sure it is there...
            Microsoft.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null
    ...
      

  3.   

    to:saucer(思归) 大俠: 下面是我在web服務器上執行的結果:C:\>gacutil -l | find "WebControls"
            Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, Public
    KeyToken=31bf3856ad364e35, Custom=null
            Microsoft.Web.UI.WebControls.resources, Version=1.0.2.226, Culture=zh-CH
    S, PublicKeyToken=31bf3856ad364e35, Custom=null
      

  4.   

    seems the version doesn't match:on your server: (1.0.2.226)Microsoft.Web.UI.WebControls, Version=1.0.2.226, Culture=neutral, Public KeyToken=31bf3856ad364e35, Custom=null
    but it is looking for (1.0.2.116)LOG: DisplayName = Microsoft.Web.UI.WebControls, Version=1.0.2.116, Culture=neutral, PublicKeyToken=31bf3856ad364e35
      

  5.   

    to:  saucer(思归)
    我的兩台機器裝的是同一個安裝程式啊,再說高版本向低版本也應兼容啊,現在的狀況是在一強機器上能運行正常,一台就出現這樣的錯誤.並且兩台機器都是裝的2000 server.
      

  6.   

    try to modify your web.config:<configuration>
       <runtime>
          <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
             <dependentAssembly>
                <assemblyIdentity name="Microsoft.Web.UI.WebControls"
                                  publicKeyToken="31bf3856ad364e35" />
                <bindingRedirect oldVersion="1.0.2.116"
                                 newVersion="1.0.2.226"/>
             </dependentAssembly>
          </assemblyBinding>
       </runtime>
    </configuration>