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

3 posts, 1 answers
  1. Cristian
    Cristian avatar
    8 posts
    Member since:
    Nov 2014

    Posted 14 Dec 2014 Link to this post

    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. Answer
    Marin Bratanov
    Marin Bratanov avatar
    3602 posts

    Posted 15 Dec 2014 Link to this post

    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.


    Marin Bratanov

    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.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cristian
    Cristian avatar
    8 posts
    Member since:
    Nov 2014

    Posted 16 Dec 2014 in reply to Marin Bratanov Link to this post

    Thanks Marin for the whole bunch of useful info you provided. In my case, forcing the domain via window.domain=... did the "trick".
Back to Top