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

Rad Window URL clicked should effect Parent window

3 Answers 192 Views
Window
This is a migrated thread and some comments may be shown as answers.
Chamira
Top achievements
Rank 1
Chamira asked on 27 Apr 2009, 04:46 PM
 RadWindow downloaddoc = new RadWindow(); 
             
            
        downloaddoc.NavigateUrl = "ThankYou.aspx"
        downloaddoc.Visible = true
        downloaddoc.VisibleOnPageLoad = true
        RadWindowManager1.Windows.Add(downloaddoc); 
this is my code which is used on a button click

I have a link in the thankYou.aspx...

Once thats clicked i want the Window to close and the Browser to go to the URL which was in the link.

Thanks in advance....

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 28 Apr 2009, 06:07 AM

Hi Chamira,

Try the following clientside code for clossing the RadWindow and redirecting the parent page to new url.

ThankYou.aspx:

 
<href="../../Window/NewLink.aspx" onclick="closeandredirect();">Go to NewLink</a> 

Here is the JavaScript used in Thankyou.aspx:
 
    
<script type="text/javascript">     
function closeandredirect(sender, args)     
{         
    GetRadWindow().BrowserWindow.location.href = '../../Window/NewLink.aspx';     
    GetRadWindow().close();       //closes the window     
}     
function GetRadWindow()   //Get reference to window  
{     
  var oWindow = null;     
  if (window.radWindow)     
     oWindow = window.radWindow;     
  else if (window.frameElement.radWindow)     
     oWindow = window.frameElement.radWindow;     
  return oWindow;     
}     
</script>  
 

Thanks,
Princy.
0
Chamira
Top achievements
Rank 1
answered on 28 Apr 2009, 09:41 AM
Thank You Princy,,,,

Marked as answer
0
Georgi Tunev
Telerik team
answered on 28 Apr 2009, 12:05 PM
Hi Chamira,

In your scenario you could also use the target attribute of the link.
i.e
<href="http://www.google.com" target="_top">My link</a> 

It will instruct the browser to open the link in the topmost page.


Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Chamira
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Chamira
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or