Error with Ajax extensions for asp.net 4.0

I am trying to get AJAX extensions working on an existing Web Forms application.

I added AjaxControlToolkit using Nuget. As a test, I set the page using a button and added a button confirmation extension.

I get this error:

0x800a138f - JavaScript Runtime Error: Unable to get 'UI' property undefined or null reference

In the following line of dynamically created Javascript:

$create(Sys.Extended.UI.ConfirmButtonBehavior, {"ConfirmText":"Are ya totally sure?","id":"MainContent_Button1_ConfirmButtonExtender"}, null, null, $get("MainContent_Button1")); 

I assume that one of the libraries is the wrong version, but I don’t know how to understand it. I tried updating packages using Nuget.

Any ideas?

Thanks!

+6
source share
2 answers

Try registering AjaxToolkit with

 <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </ajaxToolkit:ToolkitScriptManager> 
+19
source

Many of the tutorials for the Ajax Control Toolkit tell you to use the "ScriptManager" in the "Ajax Extensions" tab. With the latest versions (4.5) you need to use the "ToolkitScriptManager" from the toolkit.

+6
source

Source: https://habr.com/ru/post/951341/


All Articles