AjaxControlToolkit 7.0123 breaks VS2012 Web Application Project

Martin Robins picture Martin Robins · Apr 6, 2013 · Viewed 12.4k times · Source

I have an existing VS2012 web application that has been running fine until I added in the latest AjaxControlToolkit (7.0123). Initially, I found that the installation broke the behaviour of the UpdatePanel - whereas before I could refresh a page after an asynchronous post-back without repeating the operation I found that after installation the refresh would repeat the previous operation (I guess the post-back was no longer asynchronous).

I then noticed that, at some time in the past, I had commented out a number of the default JavaScript files that are added to a new ASP.NET Web Forms Application so I tried adding them back in. This resulted in an exception:

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

I then tried replacing the default <asp:ScriptManager .../> with <ajaxControlToolkit:ToolkitScriptManager .../> this resulted in a new exception

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

For sanity, I then created a fresh ASP.NET Web Forms Application (VS2012, Update 2) and ran it. No errors. Using "nuget", I then added the AjaxControlToolkit v7.0123 (the latest release). Ran the application again and I get the original exception again:

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

Once again, I replaced <asp:ScriptManager .../> with <ajaxControlToolkit:ToolkitScriptManager .../> and once again this results in

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

Can anybody shed any light on what else I need to do to resolve this? I can find no documentation to say anything needs to be changed manually when adding the toolkit.

Thanks,

Answer

Martin Robins picture Martin Robins · Apr 6, 2013

Answer found at http://stephenwalther.com/archive/2012/09/20/september-2012-release-of-the-ajax-control-toolkit.aspx (always just after posting the question huh)

  • Replacing <asp:ScriptManager .../> with <ajaxControlToolkit:ToolkitScriptManager .../> is correct
  • Need to remove reference to MsAjaxBundle
  • Need to remove Assembly="System.Web" from script references

This fixes the exceptions (both in the new project and the original).

It does not however resolve the problem with the UpdatePanel no longer posting back asynchronously. I will raise this as a new question.