This is a migrated thread and some comments may be shown as answers.

Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application

2 Answers 366 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jacques
Top achievements
Rank 2
Jacques asked on 29 Jan 2012, 04:21 PM
We've been experiencing a JavaScript problem with the RadControls for the past few days: 
Error: "Sys.ArgumentTypeException: Object of type 'Sys._Application' cannot be converted to type 'Sys._Application'.
Parameter Name: instance

Symptoms: The problem intermittently switches between IE6 and most other browsers. For example, if we rebuild the solution and hit the page with IE6 we don't see the exception, but if we then go to Firefox we'll see those exceptions in Firebug. If we then rebuild again and hit the page with Firefox first, it will be fine, but then IE6 starts reporting these errors. In non-IE6 browsers the error won't occur then. 

System information:
Asp.net version = 4.0
Telerik version = 2011.3.1115.40
IIS 7.5 

Solutions we had tried
1. Disabled smart navigation in the web.config file
2. Set the script mode of the script manager to release
3. Set debug = false in the web.config
None of which solved the problem...

Solution
We did discover in the end that in the RadWindow that was being shown had a button on it with its RegisterWithScriptManager set to false. When this is set to true the problem disappeared. 

Question That Still Remain
When we were initially trying to isolate the problem we had commented out the JavaScript code that launched the modal window, meaning the window wasn't being shown at all and yet the exception was still raised. The javascript code we did use was window.setUrl and window.show, so we commented out the line that called the show method. Why would this error then still come up? Is it possible that the setUrl method instantiates the window in the background without calling show()? 

Hope this saves someone else the countless days it took us to figure out where the problem was coming from. 

Regards,
Jacques

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 30 Jan 2012, 12:35 PM
Hello Jacques,

I am glad to hear you have resolved the situation and thank you for sharing your experience with the community.

Now, to your question - yes, you are correct that setUrl() creates the UI of the RadWindow and thus loads the content thaw was causing your issue. This is the way the control works and it needs to be so - in a scenario where setUrl() is called and the RadWindow's UI is not yet created and we do not create it explicitly a JavaScript error would be thrown, which should not be allowed to happen. Moreover, we must set the URL as this would be the expected behavior - although it is not shown it has the desired URL so it can be shown properly at a later stage. I hope this clears the reason for this behavior and why it cannot be changed.


All the best,
Marin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Jacques
Top achievements
Rank 2
answered on 30 Jan 2012, 01:29 PM
Hi Marin,

Thanks for the explanation. We're certainly not wanting anything changed. Just the explanation was needed, it helps us understand what to expect from the behavior.

Regards,
Jacques
Tags
Window
Asked by
Jacques
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Jacques
Top achievements
Rank 2
Share this question
or