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

Unable to self-close external MVC app launched in modal RadWindow

2 Answers 93 Views
Window
This is a migrated thread and some comments may be shown as answers.
Cristian
Top achievements
Rank 1
Cristian asked on 15 Dec 2014, 12:33 AM
So, I have the following scenario: an ASPNET webpage is launching a modal popup using RadWindow and its NavigateUrl property. The NavigateUrl points to an external, independent, ASPNET MVC application (within the same domain though). All works smoothly expect for one thing: the external MVC app has its own close logic and button to trigger that. Thing is that it obviously ain't working; the modal window hangs in there.
Being an external MVC app and all that, I guess it is out of the question to get hold of a reference to the RadWindow belonging to the host application...

Is there any solution to this scenario, at all? Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Marin Bratanov
Telerik team
answered on 15 Dec 2014, 03:13 PM

Hi Cristian,

If both pages are from the same domain, you should be able to access and close the RadWindow object as shown here: http://www.telerik.com/help/aspnet-ajax/window-client-side-basics.html#referece-from-content-page.

This requires JavaScript to be able to access on page from the other and if it does not work, you can test the access rights easily by calling a function on the main page where the RadWindow is: http://www.telerik.com/help/aspnet-ajax/window-programming-calling-functions.html. If this is successful, you can have that function close the RadWindow: http://www.telerik.com/help/aspnet-ajax/window-client-side-basics.html#referece-from-main-page.

If you cannot access the main page with JavaScript, then there is no way to close the RadWindow programmatically. You can try adding a window.domain="the.broadest.domain.possible" to both pages in an attempt to allow access to them, but I cannot guarantee this is possible, it depends on the setup you have.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Cristian
Top achievements
Rank 1
answered on 17 Dec 2014, 12:23 AM
Thanks Marin for the whole bunch of useful info you provided. In my case, forcing the domain via window.domain=... did the "trick".
Tags
Window
Asked by
Cristian
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Cristian
Top achievements
Rank 1
Share this question
or