Tuesday, October 1, 2013

Custom Extender type/class is undefined in AjaxToolkit/ASP.NET

Hi!
When running an asp.net app that includes an ajax custom extender control, a javascript alert pops up message "EXTENDER is undefined". Sample error message:
CustomExtenders.DisabledTextBehavior is undefined
where: CustomExtenders.DisabledTextBehavior is Namespace.Type

After troubleshooting for several hours, I came up with the solution:
1. Download Ajax Toolkit Stable Release for the specific .NET Framework.
 I tried versions for September release and it's not working.
2. Replace code:
Code:
CustomExtenders.DisabledTextBehavior.registerClass('CustomExtenders.DisabledTextBehavior', AjaxControlToolkit.BehaviorBase);  
To
Code:
CustomExtenders.DisabledTextBehavior.registerClass('CustomExtenders.DisabledTextBehavior', Sys.Extended.UI.BehaviorBase); 

Note: AjaxControlToolkit.BehaviorBase is used in previous versions of AjaxToolkit.
Cheers!

0 comments:

Post a Comment