Rad Window URL clicked should effect Parent window

4 posts, 1 answers
  1. Chamira
    Chamira avatar
    78 posts
    Member since:
    Nov 2007

    Posted 27 Apr 2009 Link to this post

     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....
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 28 Apr 2009 Link to this post

    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.
  3. Chamira
    Chamira avatar
    78 posts
    Member since:
    Nov 2007

    Posted 28 Apr 2009 Link to this post

    Thank You Princy,,,,

    Marked as answer
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 28 Apr 2009 Link to this post

    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.
Back to Top