Error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.


I got this error message after upgrading my ASP.NET Dynamic Data site to ASP.NET 4.5. The exception was thrown each time an entity with a data annotation referencing a field or filter control was shown. I searched for days to find out what was wrong, including numerous references to replace the ScriptManager control with the ToolkitScriptManager, but that just wasn’t the issue. So, what I finally did was to create a new blank ASP.NET Web Application in Visual Studio 2012. I wanted it somewhat empty, so I could the bits and pieces from the Ajax Control Toolkit sample site, and work out when things went wrong. At first it just didn’t. I had a bare bone application with just the AutoComplete.aspx and the DefaultMaster.master files, as well as the Ajax Control Toolkit installed from NuGet. Worked just fine. Then I started adding the script related bits from my Dynamic Data project, but to no avail. Finally, I went over the Bin folders for a comparison between the two, and after listing the ones that were “extra” in the Dynamic Data project, I double-checked if they were all needed. Turns out the Microsoft.ScriptManager.MSAjax.dll assembly was no longer used by the web application project, so I deleted it. Damned, that did the trick; unbelievable.

Advertisements

3 thoughts on “Error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

  1. thanks for this post, I had the same error for 3 days, and tried every solution I found but no result so I dropped the ajaxtoolkit till I found this post.
    thanks again.

  2. thanks. this was driving me nuts. the Microsoft.ScriptManager.MSAjax.dll wasn’t in my project per se, but it was sitting in the bin directory and at some point got copied over. a quick change in build settings to “remove additional files at destination” did the trick.

Comments are closed.