set_contentUrl causes a JavaScript error on IE

6 posts, 0 answers
  1. Jay
    Jay avatar
    86 posts
    Member since:
    Nov 2007

    Posted 18 Apr 2012 Link to this post

    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
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 24 Apr 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jay
    Jay avatar
    86 posts
    Member since:
    Nov 2007

    Posted 24 Apr 2012 Link to this post

    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
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 25 Apr 2012 Link to this post

    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.
  6. Jay
    Jay avatar
    86 posts
    Member since:
    Nov 2007

    Posted 25 Apr 2012 Link to this post

    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 :(
  7. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 27 Apr 2012 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017