Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
250 views
in Technique[技术] by (71.8m points)

ajaxcontroltoolkit - ajax control toolkit & sharepoint 2010

I was trying to use ajax control toolkit in sharepoint 2010, but i get some errors. I found that the last release of the toolkit doesn't work with SP2010, so i downloaded the version 30930 found at http://ajaxcontroltoolkit.codeplex.com/releases/view/33804 Then i modified the web.config adding this:

<assemblies>
  ....
  <add assembly="AjaxControlToolkit, Version=3.0.30930.28736, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />

I added the dll to the references (creating a new tab in the toolbox and browsing the dll file) and started using the ajax controls in my web part. It deploys without problems, but when i run my webpage i get this error:

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)

Which points to the first line of my webpart ascx file

Any ideas?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It looks like your web part references version 3.5.40412.0 of the AJAX Control Toolkit in an @Register directive. Since you want to use version 3.0.30930.28736, and since that version is properly referenced in your web.config, you should register the toolkit in your web part using its assembly name and namespace only, e.g.:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit"
    TagPrefix="ajax" %>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...