简体   繁体   English

asp.net 4.0的Ajax扩展错误

[英]Error with Ajax Extensions for asp.net 4.0

I'm trying to get AJAX extensions working on an existing Web Forms Application. 我正在尝试在现有的Web窗体应用程序上运行AJAX扩展。

I've added the AjaxControlToolkit using Nuget. 我已经使用Nuget添加了AjaxControlToolkit。 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 0x800a138f - JavaScript运行时错误:无法获取未定义或空引用的属性“UI”

On the following line in the dynamically created Javascript: 在动态创建的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. 我试图使用Nuget更新包。

Any ideas? 有任何想法吗?

Thanks! 谢谢!

Try to register the AjaxToolkit with 尝试注册AjaxToolkit

<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. Ajax Control Toolkit的许多教程都告诉您使用Ajax Extensions选项卡中的“ScriptManager”。 With the latest versions (4.5) you need to use the "ToolkitScriptManager" from the toolkit. 使用最新版本(4.5),您需要使用工具包中的“ToolkitScriptManager”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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