Wednesday, February 10, 2010

AjaxControlToolkit and SmartNavigation

After spending almost 4 hours investigating the following problem with an Ajax extension object:




‘Error: Sys.ArgumentTypeException: Object of type ‘AjaxControlToolkit.PopupBehavior’ cannot be converted to type ‘AjaxControlToolkit.PopupBehavior’.
I finally realized the page was using the smartNavigation directive. This directive has become obsolete with .NET 2.0, you can now use Page.SetFocus() and Page.MaintainScrollPositionOnPostBack() instead to obtain similar result. However, during the upgrade process from 1.1, the wizard didn’t flag this directive as a problem, so I was not aware of its presence until I came across the problem above.
Anyway, I was not surprised that upon removing this directive, the page was no longer throwing the javascript exception.
Lesson learned.

source : http://rafsystems.com/2007/05/22/ajaxcontroltoolkit-and-smartnavigation/

No comments:

Post a Comment