AjaxControlToolkit and SmartNavigation

After spending almost 2 hours investigating the following problem with a Ajax dropdown 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.

8 Responses to “AjaxControlToolkit and SmartNavigation”

  1. david_vo Says:

    Rafael, without your post I think I never wouldn’t found this issue on my ASP.NET 2.0 site.
    After removing smartnavigation attribute the javascript error disappeared.

    Error: Sys.ArgumentTypeException: Object of type ‘AjaxControlToolkit.MaskedEditbehavior’ cannot be converted to type ‘AjaxControlToolkit.MaskedEditbehavior’.

    thx,
    David

  2. Joel Hulen Says:

    You are my hero! How did you ever determine that smartNavigation was at fault? Probably some nasty trial and error. You’ve got to love unrelated error messages :)

    Thanks,
    Joel

  3. Panos Says:

    Man you saved my mental health with this post! ;)

  4. rloureiro Says:

    I’ve had problems with Smartnavigation before, so after I had spent two hours trying to get this fixed to no avail, I decided to remove SmartNavigation and baaaam! everything started working like a dream.

  5. Jonas Says:

    I have been sitting with this problem for months, and now it is solved!!!
    We had many weird errors on our production web and they were basially untraceable…
    Thanks! :) :) :)

  6. David Griebel Says:

    Awesome - thanks for posting this. You are the only person on the internet with the solution to this problem!

  7. Sam Says:

    Thanks for this post, you save me from a waste of time !

  8. Boris Says:

    Thanks a lot! Really saved a lot of time for me!

Leave a Reply