在ASP.NET应用程序上启用AJAX时出现问题

时间:2010-06-04 18:28:46

标签: ajax sharepoint

我一直在摸索将我的代码部署到SharePoint 2007网站几个小时。我的项目中有ajax,并且在sharepoint服务器上启用了ajax。我现在收到此错误:

但其类型(System.Web.UI.ScriptManager)与控件类型(System.Web.UI.ScriptManager)不兼容。

有人可以帮我指点正确的方向吗?我知道我有一些版本问题...我的项目是在VS 3.5上开发的.NET 3.5,而SharePoint应用程序是.NET 2.0,启用了ajax。

感谢。

2 个答案:

答案 0 :(得分:1)

尝试将此添加到您正在处理的Web应用程序的“运行时”部分web.config中:

在运行时部分的“assemblyBinding”部分下:

<dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
  </dependentAssembly>
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
  </dependentAssembly>

答案 1 :(得分:0)

我知道解决这个问题的唯一方法是使它们成为相同的版本...使用.NET 2.0版本;我不知道你是否可以采用其他任何方式...... System.Web.UI.ScriptManager之间的区别就是版本。要测试,请使用带有脚本管理器的.NET 2.0部署示例应用程序,然后尝试一下。