我试图在sharepoint 2010中使用ajax控件工具包,但是我遇到了一些错误。我发现该工具包的最新版本不适用于SP2010,因此我下载了http://ajaxcontroltoolkit.codeplex.com/releases/view/33804处的30930版本 然后我修改了web.config,添加了这个:
<assemblies>
....
<add assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
我将dll添加到引用中(在工具箱中创建一个新选项卡并浏览dll文件)并开始在我的Web部件中使用ajax控件。它部署没有问题,但当我运行我的网页时,我收到此错误:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load file or assembly 'AjaxControlToolkit, Version=3.5.40412.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
指向我的webpart ascx文件的第一行
有什么想法吗?
答案 0 :(得分:2)
看起来您的Web部件在@Register
指令中引用了AJAX Control Toolkit的版本3.5.40412.0。由于您要使用版本3.0.30930.28736,并且由于您的web.config
中正确引用了该版本,因此您应该仅使用其程序集名称和命名空间在Web部件中注册该工具包,例如:
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
TagPrefix="ajax" %>
答案 1 :(得分:2)
看看这篇博客文章,该文章解释了如何在SharePoint 2010中使用Ajax Control Toolkit http://www.inspiredbytechnology.com/index.php/2010/10/28/using-the-ajax-control-toolkit-with-sharepoint-2010/