日期:2014-05-17  浏览次数:20558 次

未能加载用户控件类型
我的网站下面有个usercontrol文件夹,下面有4个用户控件TOP.ascx,Left.ascx,Bottom.ascx,Navigation.ascx,
我调试的时候,出现个错误,以Bottom.ascx为例:
错误 4 未能加载类型“usercontrol_Bottom”。 G:\WorkSpace\echao\usercontrol\Bottom.ascx 1
求高手请教,这是什么意思?

我的用户控件
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Bottom.ascx.cs" Inherits="usercontrol_Bottom" %>
<%@ OutputCache Duration="120" VaryByParam="*" Shared="true" %>
<div class="foot">
  <%=bottom%>
</div>

里面的代码:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Xml;


public partial class usercontrol_Bottom : System.Web.UI.UserControl
{
  protected string bottom = "";
  protected void Page_Load(object sender, EventArgs e)
  {
  XmlDocument xmldoc = new XmlDocument();
  xmldoc.Load(Server.MapPath("Admin/xml/WebFoot.xml"));
  XmlNode xn = xmldoc.SelectSingleNode("foot");
  XmlNodeList xnl = xn.ChildNodes;
  foreach (XmlNode node in xnl)
  {
  XmlElement xe = (XmlElement)node;
  if (xe.Name == "content")
  {
  bottom = Server.UrlDecode(xe.InnerText);
  }
  }
  }
}

------解决方案--------------------
.aspx页面没有注册该控件吧???

例:
HTML code

<%@ Register src="UserControls/SiteMap.ascx" tagname="SiteMap" tagprefix="ucSiteMap" %>