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

set_contentUrl causes a JavaScript error on IE

5 Answers 107 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 19 Apr 2012, 02:37 AM
When using RadSplitter, if I call RadPane.set_contentUrl and pass the URL of a PDF document, it will sucessfully navigate the pane and show the PDF, but then it shows a Javascript error after it displays the PDF. I believe this is because in IE, when displaying a PDF there may not be a window object. The stack trace for the JS error shows it in the Sys$_Application$dispose routine in the AJAX class where it accesses the window object. The problem is the window object throws "Invalid calling object" when accessed.This only occurs when navigating to a PDF, and from a page that uses RadAjaxPanel.

Any ideas?
Thanks

5 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 24 Apr 2012, 08:10 AM
Hi Jay,

This problem is not directly related to RadSplitter but is an issue with the MS AJAX Framework and how an <iframe> is disposed. You can observe the same behavior using standard <iframe> with initially loaded a page containing scriptmanager, and then change the its SRC to load a PDF file. For your convenience I have attached a sample page demonstrating this issue.

I have logged this into our database for further investigation, and we will try to handle it (if possible) for one of the upcoming releases.

Regards,
Dobromir
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
Jay
Top achievements
Rank 1
answered on 25 Apr 2012, 02:02 AM
Thanks. I was afraid this was the case. If you guys do figure out a way to handle this error it would be great. I douby MS AJAX will ever change
0
Dobromir
Telerik team
answered on 25 Apr 2012, 08:40 AM
Hi Jay,

I was able to workaround this issue in Internet Explorer by setting about:blank as URL and then the PDF with a slight timeout to give the browser time to dispose it, e.g:

var pane = $find("<%=RadSplitter1.ClientID%>").getPaneById("<%=RadPane2.ClientID");
pane.set_contentUrl("about:blank");
setTimeout(function ()
{
    pane.set_contentUrl("VS-KB-Brochure-CSharp-Letter.pdf");
}, 0);


Greetings,
Dobromir
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
Jay
Top achievements
Rank 1
answered on 26 Apr 2012, 03:25 AM
That is a clever approach. Unfortunately, in my case, the pane itself (rather JS running on the page currently displayed in the pane) is calling set_contentUrl, so when it calls
MyPane.set_contentUrl("about:blank");
the next link of JavaScript code is never hit :(
0
Dobromir
Telerik team
answered on 27 Apr 2012, 09:44 AM
Hi Jay,

In such case, I would suggest you to extract the portion of the code that sets the contentUrl to the pane on the parent page (where the splitter resides) and call that function from within the pane's content page. Please review the following KB article for an example on how to reference the parent page:
Referencing content page in a splitter pane from the parent page and vice versa

Regards,
Dobromir
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.
Tags
Splitter
Asked by
Jay
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Jay
Top achievements
Rank 1
Share this question
or