My company's website uses the AjaxControlToolkit in a few different areas. I was assigned a project that required using an updated version of the toolkit. (the previous version's textbox Calendar extender didn't have the "StartDate" and "EndDate" properties.
yeah, it was old.)
So, I upgraded to the latest and greatest by adding the NuGet package, and deleted the old DLL.
A few (legacy) pages were using the toolkit in UpdatePanels. I have changed the ScriptManagers on those pages to the ToolkitScriptManager.
The Problem:
The pages with UpdatePanels (UpdateMode="always" ChildrenAsTriggers="true") have an asp:Timer in them. When the page loads, everything is fine. Then, after a seemingly random number of async postbacks (usually the first, and always less than 3), they throw
the following JavaScript error:
Uncaught Sys.InvalidOperationException: Sys.InvalidOperationException: The script 'Timer.js' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.
I haven't been able to reproduce the error in my local version, so far it only happens on our development servers. Unfortunately, the person who wrote the system doesn't work here anymore, and no one has had to touch it until now (lucky me), so I've
just been trying things for the last few days...
I've tried moving the timer outside the update panel and setting it as an asyncpostback trigger on the update panel, but that causes other strangeness on the page. I've replaced ScriptManager with ToolkitScriptManager. I've set CombineScripts to false.
I've removed calls to ScriptManager and ClientScript, and replaced them with ToolkitScriptManager. None of this has helped.
Any helpful thoughts are greatly appreciated.
Thanks.