在本地主机上尝试查看我的项目时出现此错误。
已验证AjaxControlToolkit在我的项目引用中设置。
AjaxControlToolkit.dll位于引用列表中列出的目录中。
我重新安装了AjaxControlToolkit,以确保这不是问题。
我正在处理的项目是由同事通过电子邮件发送给我的项目,并不是我从头开始创建的东西。不确定是否存在该问题,并且该项目正在查看旧参考资料?
另外,我有一个单独的解决方案中的另一个测试项目,并添加了一个AjaxControlToolkit控件来进行测试(CalendarExtender),它运行得非常好。
张贴我的代码:
Web配置文件:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="TESTConnectionString" connectionString="Data Source=(localdb)\v11.0;Initial Catalog=TEST;Integrated Security=True" providerName="System.Data.SqlClient"/>
<add name="TESTConnectionString2" connectionString="Data Source=(localdb)\v11.0;Initial Catalog=TEST;Integrated Security=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<httpRuntime targetFramework="4.5" />
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--<pages>-->
<!--<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=4.97.4951.28478, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f" />
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="asp" />
--><!--<add namespace="AjaxControlToolkit, Version=4.97.4951.28478, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f"/>
<add tagPrefix="asp" namespace="AjaxControlToolkit" assembly="AjaxControlToolkit, Version=4.97.4951.28478, Culture=neutral, PublicKeyToken=21ef50ce11b5d80f"/>--><!--
</controls>
</pages>-->
</system.web>
</configuration>
母版页:
<%@ Master Language="C#" %>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta charset="utf-8" />
<title></title>
<asp:ContentPlaceHolder id="head" runat="server" />
</head>
<body>
<form id="form1" runat="server">
<div>
<%--<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>--%>
<%--<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>--%>
<asp:ContentPlaceHolder id="Content2" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server" />
</div>
</form>
</body>
</html>
在主要的.aspx页面中,通过toolkitscriptmanager标签置顶:
<%@ Page Title="" Language="C#" MasterPageFile="MasterPage.master" AutoEventWireup="true" CodeFile="MAIN.aspx.cs" Inherits="admin_Payments" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix ="asp" %>
<asp:Content ContentPlaceHolderID="head" runat="Server">
<style type="text/css">
.auto-style1 {
text-align: left;
font-size: medium;
}
.auto-style2 {
font-size: medium;
}
.auto-style3 {
height: 577px;
}
</style>
</asp:Content>
<asp:Content contentplaceholderid="Content2" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
..................
assemblyBinding
。它是否存在? - Shahid Iqbal