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

Response.Redirect for Page, not Window

2 Answers 132 Views
Window
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 15 Nov 2010, 11:04 PM
Hello,

I have a radwindow open.  I issue a Response.Redirect, but it navigates in the window.  I need to navigate in the whole page.  How can I do that when the rad window is open?  The request is obviously issued from the view within the radwindow?  All pages being viewed (master and in the radwindow) are within the application.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 16 Nov 2010, 02:32 PM
Hello Brian,

I don't see it being done using Response.Redirect. You need to return a client-script to do the redirection of the parent window. Something like this:

function GetRadWindow() {
                var oWindow = null;
                if (window.radWindow) oWindow = window.radWindow;
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
                return oWindow;
            }
  
            function RedirectParent() {
                var oWnd = GetRadWindow();
  
                oWnd.BrowserWindow.location = "Default.aspx";
            }

I hope that helps.
0
Georgi Tunev
Telerik team
answered on 17 Nov 2010, 09:17 AM
Hi guys,

Brian, Cory is right - when RadWindow displays a content page (e.g. NavigateUrl is set), the control uses a standard IFRAME and acts just like one. All functions (server or client ones) that you execute in that content page are executed in its context only. That is why Response.Redirect redirects the content page and not the parent one.
To be able to redirect the parent page, you will have to use client-side approach like the one that Cory suggested. If you need to execute some server-side function first, I would suggest to execute it and then, at the end of that function, to output JavaScript that will run a function like the one Cory posted. See this blog post for more information on how to output JS from server.

Greetings,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Georgi Tunev
Telerik team
Share this question
or