我有一个现有的 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 .../>
正确 这修复了异常(在新项目和原始项目中)。
然而,它并没有解决 UpdatePanel 不再异步回发的问题。我将提出这个问题作为一个新问题。
关于AjaxControlToolkit 7.0123 破坏 VS2012 Web 应用程序项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15851857/