Close and redirect parent page

5 posts, 1 answers
  1. Saeid Kdaimati
    Saeid Kdaimati avatar
    48 posts
    Member since:
    May 2006

    Posted 01 Apr 2010 Link to this post

    Hi,

    I'm using RAD Q3 2009, I have an open window which include some controls (textbox and rad combo), I need to do the following when a user click a close button (asp.net button):
    1. return a url to the parent page.
    2. redirect parent page to the new url.
    3. close the window.

    Thank you.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Apr 2010 Link to this post

    Hello,

    Attach onclick event to the button placed in RadWindow, pass the url as parameter as shown in the example.

    JavaScript:

     
    function closeWindow()  
    {  
       var oWnd = GetRadWindow();  
       oWnd.close(url);  
    }  
    function GetRadWindow()  
    {  
      var oWindow = null;  
      if (window.radWindow)  
         oWindow = window.radWindow;  
      else if (window.frameElement.radWindow)  
         oWindow = window.frameElement.radWindow;  
      return oWindow;  

    In the OnClientCose event of RadWindowManager, redirect to new page.

    JavaScript:

     
        function OnClientClose(sender, args) {  
            window.location.href = args.get_argument();  
        } 

    Also checkout the link for more information on this.

    Using RadWindow as a Dialog

    -Shinu.

  3. Saeid Kdaimati
    Saeid Kdaimati avatar
    48 posts
    Member since:
    May 2006

    Posted 05 Apr 2010 Link to this post

    Thank u Shinu, it works.
  4. Julie
    Julie avatar
    27 posts
    Member since:
    Dec 2008

    Posted 30 Sep 2011 Link to this post

    Hi Telerik support,
    I would like to know how you would show the loading panel on the parent page during the re-direction, it is taking a few seconds to load the page based on the new url, most of which is dynamic content being loaded from a database.  I don't want my users to get impatient while it is in process of loading the new url, and feel the loading panel is something they are already used to.  Please provide a concrete example, I have already tried suggestions documented in help, and they did not work.

    Thank you 
    Julie

  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4627 posts

    Posted 03 Oct 2011 Link to this post

    Hi Julie,

    Using the RadAjaxLoadingPanel is not possible during a redirect. Actually - any AJAX-enabled control will not fit your scenario, as they are loaded quite late in the page lifecycle - after the window.onload event fires and are available, at earliest, in the Sys.Application.Load event, at which point your entire page has loaded.

    What you can do is create two divs in your page - one initially shown with a loading message and one that has the main content, initially hidden (via CSS, of course) and you can change their display in the Sys.Application.Load event. A small example is attached to this thread. Please note the utilization of the setTimeout method to delay the switch of the panels in order for the effect to be more visible and to simulate a heavy page being loaded.

    Please note that having controls in initially hidden containers may sometimes result in unexpected layout changes, so you may leave the main contents visible, just hide the loading sign (which will need a high z-index, of course). You may additionally style the loadingSign div to match your needs.

    Greetings,
    Marin
    the Telerik team
    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 their blog feed now
Back to Top