Url Change Parent window on RadWindow Close

6 posts, 0 answers
  1. Myo
    Myo avatar
    24 posts
    Member since:
    Nov 2013

    Posted 28 Nov 2013 Link to this post

    Please Anybody can help me? 
    I cann't change parent window url after radwindow close.
    this is code on parent window .
     function UpdateParentPage(args) {

                    if (args != null && args != '') {
                        if (args.startsWith('MoveReservation')) {
                            UpdateParentPageWithAjaxRequest('GrpResRoomRebind');
                        }
                        else if (args.startsWith('CheckIn')) {
                            window.location.reload();
                        }
                        else {
                            UpdateParentPageWithAjaxRequest('ReBindTransList');
                           // RedirePage();
                        }
                    }
                }
                function RedirePage()
                {
                   top.location.href= "../../Reservation/FolioNew.aspx";
                }
    .....
    Code on RadWindow
       function ResizeAndClose(width, height, key) {
                        //if (document.referrer.indexOf("/Update/ReservationDetails.aspx") > 0) {

                        //    top.location.href = '../../Reservation/FolioNew.aspx?';

                        //}
                        GetRadWindow().setSize(width, height);
                       
                        setTimeout('GetRadWindow().close("")', 100);
                       
                        GetRadWindow().BrowserWindow.UpdateParentPage(key);
                        GetRadWindow().BrowserWindow.RedirePage();

                       
                    }

    What i want is after process this  GetRadWindow().BrowserWindow.UpdateParentPage(key), want to go redirepage. 

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3600 posts

    Posted 29 Nov 2013 Link to this post

    Hello Myo,

    I am attaching here a simple example that shows how redirects can work, and I have added some comments to aid you. Note that how you devise these functions depends on your code, requirements and preferences, not on our controls.


    Regards,
    Marin Bratanov
    Telerik
    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 the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Myo
    Myo avatar
    24 posts
    Member since:
    Nov 2013

    Posted 01 Dec 2013 Link to this post

    Hello Marin,

    I have tried to call my redirect page function from parent window (once after processing done) or call from child window itself. But both methods are failed to redirect to another page. 

    When I trace, top.location.href does not change even though I passed the full parameter path. 

    Could you please  enlighten me, which part is wrong? 

    Code in parent page:-
    function UpdateParentPageWithAjaxRequest(command) {
                    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
                    ajaxManager.ajaxRequest(command);
                    alert(command);
                    if (command.startsWith('ReBindTransList')) {
                        alert("2");
                        RedirePage();
                    }
                   
                }
    function RedirePage()
                {                
                    top.location.href = '/Reservation/FolioNew.aspx';               
                }


    Basically what I need is:- 
    1) parent page called child page (content page)
    2) change some information & close it
    3) update function fired in parent page 
    4) navigate to new page (Reservation/FolioNew.aspx which is located under same project but different folder)

    At point 4, I tried to use "top.location.href = <url>" or "window.location.href = <url>". However, both methods do not navigate as expected. 

    As I'm very new in Telerik controls, appreciate any sample project with three simple pages & redirect functionality. Thanks in advance. 

  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Dec 2013 Link to this post

    Hi Myo,

    Please try the following JavaScript to achieve your scenario.

    JavaScript:
    function RedirePage() {
        document.location.href = '../Reservation/FolioNew.aspx';
    }

    Thanks,
    Shinu.

  6. Myo
    Myo avatar
    24 posts
    Member since:
    Nov 2013

    Posted 02 Dec 2013 Link to this post

    Hi Shinu,

    It is working on Chrome and FireFox but not working on IE. Please give me some advices.

    Thanks
  7. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Dec 2013 Link to this post

    Hi Myo,

    Unfortunately I couldn't replicate the issue at my end. The given code is working fine at my end. As a suggestion please try the JQuery code to redirect to another page.

    JavaScript:
    <script src="../JS/jquery-1.10.1.min.js"></script>
    <script tye="text/javascript">
        function RedirePage() {
            var url = '../Reservation/FolioNew.aspx';
            $(location).attr('href', url);
        }
    </script>

    Hope this will helps you.
    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017