简体   繁体   中英

Error with Ajax Extensions for asp.net 4.0

I'm trying to get AJAX extensions working on an existing Web Forms Application.

I've added the AjaxControlToolkit using Nuget. As a test I setup a page with a button and added a button confirmation extension.

I'm getting this error:

0x800a138f - JavaScript runtime error: Unable to get property 'UI' of undefined or null reference

On the following line in the dynamically created Javascript:

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

I'm guessing that one of the libraries is the wrong version, but don't know how to go about figuring this out. I've tried to update packages using Nuget.

Any ideas?

Thanks!

Try to register the AjaxToolkit with

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM