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

Open Radwindow with different domain

5 Answers 95 Views
Window
This is a migrated thread and some comments may be shown as answers.
Niranjan
Top achievements
Rank 1
Niranjan asked on 26 Aug 2020, 05:51 PM

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".

5 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 31 Aug 2020, 07:35 AM

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).

0
Niranjan
Top achievements
Rank 1
answered on 31 Aug 2020, 10:25 PM

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.

0
Peter Milchev
Telerik team
answered on 01 Sep 2020, 06:48 AM

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/.

0
Niranjan
Top achievements
Rank 1
answered on 01 Sep 2020, 04:43 PM
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?
0
Peter Milchev
Telerik team
answered on 01 Sep 2020, 04:59 PM

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/.

Tags
Window
Asked by
Niranjan
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Niranjan
Top achievements
Rank 1
Share this question
or