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

Close and redirect parent page

4 Answers 401 Views
Window
This is a migrated thread and some comments may be shown as answers.
Saeid Kdaimati
Top achievements
Rank 2
Saeid Kdaimati asked on 01 Apr 2010, 10:24 AM
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.

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Apr 2010, 12:04 PM

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.

0
Saeid Kdaimati
Top achievements
Rank 2
answered on 05 Apr 2010, 07:10 AM
Thank u Shinu, it works.
0
Julie
Top achievements
Rank 1
answered on 30 Sep 2011, 05:47 AM
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

0
Marin Bratanov
Telerik team
answered on 03 Oct 2011, 09:44 AM
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
Tags
Window
Asked by
Saeid Kdaimati
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Saeid Kdaimati
Top achievements
Rank 2
Julie
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or