Tag: Ajax Control Toolkit

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.


Invalid Animation definition for TargetControlID=”…”: The ‘Animations’ start tag on line x position x does not match the end tag of ‘OnHide’. Line x, position x.

I was adding filters (grabbed from “Dynamic Data Steve’s” website here, http://csharpbits.notaclue.net/2010/11/five-cool-filters-for-dynamic-data-4.html) to my Dynamic Data website and the Autocomplete filter makes use of the AJAX Control Toolkit, http://ajaxcontroltoolkit.codeplex.com/. Steve has done a fantastic job over the years with customizing many aspects of Dynamic Data, so I was a little sad to see that I got this error Invalid Animation definition for TargetControlID=”…”: The ‘Animations’ start tag on line x position x does not match the end tag of ‘OnHide’. Line x, position x., when trying to view a table/entity in the ListDetails view. After quite a thorough investigation, it turned out it was because of the presence of the VisualStudioDesignTime key you can add to your appSettings element in web.config.
     VisualStudioDesignTime:Enabled" value="true" />
It is used by the new Page Inspector, which you can find information about here, http://blogs.msdn.com/b/webdevtools/archive/2011/09/22/page-inspector-for-visual-studio-11-developer-preview.aspx. Remove the add element/tag and the error goes away.


After updating to Visual Studio 2012 RC, I now get the error whether or not the VisualStudioDesignTime:Enabled key is present or not. However, if I remove the 4 comments within the opening and closing ajaxToolkit:AutoCompleteExtender tags, everything works just fine, even with the VisualStudioDesignTime:Enabled key present. 🙂