Open Radwindow with different domain

6 posts, 0 answers
  1. Niranjan
    Niranjan avatar
    3 posts
    Member since:
    Mar 2016

    Posted 26 Aug 2020 Link to this post

    I have a main page opening a radwindow with URL pointing to another domain. Now is there a way to track the rad window closing in the opening domain?

    Main Page: https://www.sitename.com/subdomain1/mainpage.aspx

    Radwindow URL: https://www.sitename.com/subdomain2/windowpage.aspx

    When the Radwindow is closed i am able to trigger an event in "subdomain1/mainpage.aspx". But i would like to trigger an event (server side or client side) in "subdomain2/windowpage.aspx".

  2. Peter Milchev
    Admin
    Peter Milchev avatar
    899 posts

    Posted 31 Aug 2020 Link to this post

    Hello Niranjan,

    You can try the OnClientBeforeClose event and access the child page where you can call some JavaScript function depending on your scenario.

    Otherwise, you can use the main page server-side to execute the needed logic as the RadWindow loads the child page in an iframe, which is inaccessible on the server-side.

    Regards,
    Peter Milchev
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

  3. Niranjan
    Niranjan avatar
    3 posts
    Member since:
    Mar 2016

    Posted 31 Aug 2020 in reply to Peter Milchev Link to this post

    Peter,

    Thanks for the response. But the OnClientbeforeclose event is firing only in the calling page, in this case https://www.sitename.com/subdomain1/mainpage.aspx. But i want to handle something before the window closes in the Radwindow page (different domain) https://www.sitename.com/subdomain2/windowpage.aspx.

  4. Peter Milchev
    Admin
    Peter Milchev avatar
    899 posts

    Posted 01 Sep 2020 Link to this post

    Hello Niranjan,

    Yes, the function is called on the main page because that is where the RadWindow resides. 

    My suggestion was to use this event in the main page, access the child page via JavaScript and execute some predefined function inside the child page.

    Regards,
    Peter Milchev
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  5. Niranjan
    Niranjan avatar
    3 posts
    Member since:
    Mar 2016

    Posted 01 Sep 2020 in reply to Peter Milchev Link to this post

    Since the child page is in a different sub domain i am not sure if security will allow java script to be invoked from parent page. Do you have a sample code for this?
  6. Peter Milchev
    Admin
    Peter Milchev avatar
    899 posts

    Posted 01 Sep 2020 Link to this post

    Hello Niranjan,

    When the NavigateURL is passed to the RadWindow, it just loads the url in an <iframe> element. That means the same approach would work and the same issues will occur as if you were loading your child page in a simple <iframe>. 

    Also, you can find the following article helpful to accessing the child page if the loaded page allows it:

    Regards,
    Peter Milchev
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Back to Top