Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with Ajax Extensions for asp.net 4.0

Tags:

c#

ajax

asp.net

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!

like image 994
pStan Avatar asked Aug 08 '13 17:08

pStan


2 Answers

Try to register the AjaxToolkit with

<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</ajaxToolkit:ToolkitScriptManager>
like image 95
PiLHA Avatar answered Sep 29 '22 17:09

PiLHA


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.

like image 43
mcolegro Avatar answered Sep 29 '22 17:09

mcolegro