AjaxControlToolkit 7.0123 破坏 VS2012 Web 应用程序项目

标签 ajaxcontroltoolkit asp.net-4.5

我有一个现有的 VS2012 Web 应用程序,它一直运行良好,直到我添加了最新的 AjaxControlToolkit (7.0123)。最初,我发现安装破坏了 UpdatePanel 的行为 - 而在我可以在异步回发后刷新页面而不重复操作之前,我发现安装后刷新会重复之前的操作(我猜是回发不再是异步的)。

然后我注意到,在过去的某个时候,我已经注释掉了一些添加到新 ASP.NET Web 窗体应用程序的默认 JavaScript 文件,因此我尝试重新添加它们。 这导致了异常:

'MsAjaxBundle' is not a valid script name. The name must end in '.js'.



然后我尝试替换默认的 <asp:ScriptManager .../><ajaxControlToolkit:ToolkitScriptManager .../>这导致了一个新的异常

Could not load file or assembly 'System.Web' or one of its dependencies. The system cannot find the file specified.



出于理智,我然后创建了一个新的 ASP.NET Web 窗体应用程序(VS2012,更新 2)并运行它。没有错误。使用“nuget”,然后我添加了 AjaxControlToolkit v7.0123(最新版本)。再次运行应用程序,我再次得到原始异常:

'MsAjaxBundle' is not a valid script name. The name must end in '.js'.



我又换了<asp:ScriptManager .../><ajaxControlToolkit:ToolkitScriptManager .../>这再次导致

Could not load file or assembly 'System.Web' or one of its dependencies. The system cannot find the file specified.



任何人都可以说明我还需要做什么来解决这个问题吗?我找不到任何文档说明在添加工具包时需要手动更改任何内容。

谢谢,

最佳答案

答案在 http://stephenwalther.com/archive/2012/09/20/september-2012-release-of-the-ajax-control-toolkit.aspx 中找到(总是在发布问题之后哈)

  • 更换 <asp:ScriptManager .../><ajaxControlToolkit:ToolkitScriptManager .../>正确
  • 需要删除对 MsAjaxBundle 的引用
  • 需要从脚本引用中删除 Assembly="System.Web"

  • 这修复了异常(在新项目和原始项目中)。

    然而,它并没有解决 UpdatePanel 不再异步回发的问题。我将提出这个问题作为一个新问题。

    关于AjaxControlToolkit 7.0123 破坏 VS2012 Web 应用程序项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15851857/

    相关文章:

    asp.net - 如何仅在单击按钮时激活验证器

    c# - Ajax FilteredTextBoxExtender 不起作用

    c# - 如果表达式不匹配,LINQ 返回表达式

    c# - 无法声明接口(interface) "async Task<myObject> MyMethod(Object myObj); "

    asp.net-mvc-3 - 如何将 MVC 3 项目升级到 .NET 4.5 [不是 MVC 4]

    asp.net - .NET 4.5 WebForms : do I (still) really have to specify all 3 templates in a FormView?

    c# - 添加动态评级控件时出现奇怪的编译问题

    javascript - 最好的开源 JavaScript 树?

    c# - 类型定义存在于两个库中

    asp.net ModalPopupExtender : need to show scroll bar when overflow