views:

54

answers:

1

I have an asp.net web site where I'm trying to resolve what looks like a problem with ASP.NET AJAX:

Microsoft JScript runtime error: Sys.ArgumentTypeException: Object of type 'Sys.Extended.UI.AccordionBehavior' cannot be converted to type 'Sys.UI.Behavior'. Parameter name: instance

I've googled around a lot, and looked at the code presented (see below, no idea what it means) but no luck.

I've tried changing scriptmanger scriptmode to release, and a bunch of other things too. Anyone have any ideas?

Details:

  • Visual Studio 2010
  • ASP.NET 4.0
  • Ajax control toolkit 4.0
  • jQuery 1.4.2
  • jQuery UI 1.8.5

JS Code the error occurs in, inside ScriptResource.axd:

dispose:function()
{
var c=this;
b.UI.Behavior.callBaseMethod(c,eb); --------- this line 
var d=c._element;
if(d)
{
var f=c.get_name();
if(f)
d[f]=a;
var e=d._behaviors;
Array.remove(e,c);
if(!e.length)
d._behaviors=a;
delete c._element
}

}

Declaration of accordion control:

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="atlas" %>

(snip)

<atlas:Accordion ID="menu" runat="server" SelectedIndex="0"
    ContentCssClass="accordionContent" FadeTransitions="true" FramesPerSecond="30"
    TransitionDuration="250" AutoSize="None" Width="270">
</atlas:Accordion>

*Update: *
Added accordion control declaration as requested, is there anything else I can add that could be useful?

Does anyone have any idea about this error at all - am I right in thinking it's MS AJAX not playing nicely with other javascript (probably jQuery UI) on the page?

A: 

Are you using update panels on your page at all? If so, remember that once you add controls inside\outside of an update panel, the "scope" of objects included in a postback changes dramatically, as only objects wrapped within an UpdatePanel are included.

If this doesnt help, I apologize, but my experiences with ASP.NET AJAX have added a layer of complexity to the postback model with sites Ive implemented it on.

ewitkows
Yes there is an update panel on another part of that page (not near the ajax toolkit control or the jquery-using bits. It encloses a user control with a telerik treeview in it. *sighs at over-complexity of inherited app*
MGOwen