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

RADWINDOW - Response Redirect

7 Answers 505 Views
Window
This is a migrated thread and some comments may be shown as answers.
Narsing
Top achievements
Rank 1
Narsing asked on 27 Dec 2011, 05:01 AM
Consider an example.....

a) I display a web-page "Page1.aspx"  in rad-window.....and inside this web-page on a button click i response.redirect to another web-page "Page2.aspx"..How do i make this  "Page2.aspx" open in the same window but do not display in "RadWindow".


Thanks

7 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 27 Dec 2011, 06:33 AM
Hello,

Try the following.
ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
  <Windows>
     <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true">
         <ContentTemplate>
             <asp:Button ID="Button1" runat="server" Text="Redirect" OnClick="Button1_Click" />
          </ContentTemplate>
      </telerik:RadWindow>
  </Windows>
</telerik:RadWindowManager>

CS:
protected void Button1_Click(object sender, EventArgs e)
  {
    Response.Redirect("Default2.aspx");
  }

-Shinu.
0
Svetlina Anati
Telerik team
answered on 27 Dec 2011, 10:07 AM
Hello Narsing,

As far as I understand you are using a RadWindow with NavigateUrl instead of a ContentTemplate as Shinu thought. If so, to achieve waht you want you should go through the following steps:


1) Use the Response.Redirect method in the server handler of the button of Page1.aspx.
2) Put the following script in Page2.aspx:


if (window != window.top) window.top.location.href = window.location.href;


The step in 1) will cause the Page2.aspx to start loading and the code from 2) will force it to load in the main browser window instead of the RadWindow.



Please, test my suggestion and let me know how it goes. 

All the best,
Svetlina Anati
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
0
Dev
Top achievements
Rank 1
answered on 09 Feb 2013, 02:54 AM
Thank You Svetlina Anati. It did work. I had the same issue and it worked for me.
 Thank you. But the problem is page 2 showed up in the rad window for a moment before opening in the same window. In addition i have used the line of code you just mentioned in my document.ready function on page 2. How can i avoid the momentary opening of page 2 on the rad window? 

0
Marin Bratanov
Telerik team
answered on 11 Feb 2013, 01:53 PM
Hi,

In order for this framebuster script to work it has to be reached by the browser, so the page must first start downloading in the RadWindow. The earlier the script is executed, the earlier it will redirect the main page, so the beginning of the head section is the best place for it.


All the best,
Marin Bratanov
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.
0
Varun
Top achievements
Rank 1
answered on 13 Nov 2013, 12:18 PM

 Hi,
I have apply a master page to rad window....
In Master Page there is a user control which containg Hyperlink ...
I want to redirect to plane .aspx page from hyperlink and want to close the radwindow..
Pls let me know solution for above....

0
Marin Bratanov
Telerik team
answered on 14 Nov 2013, 02:21 PM
Hi Varun,

If the hyperlink is in the RadWindow and you want it to open in the browser itself you should add the target="_top" attribute to it, because RadWIndow loads its content page in an iframe.
At this point the main page will be redirected and the RadWindow will be lost.


Regards,
Marin Bratanov
Telerik
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 the blog feed now.
0
Varun
Top achievements
Rank 1
answered on 15 Nov 2013, 06:42 AM
HI Marin,

Thank you so much for above solution ....
Its working....


Varun
Tags
Window
Asked by
Narsing
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Svetlina Anati
Telerik team
Dev
Top achievements
Rank 1
Marin Bratanov
Telerik team
Varun
Top achievements
Rank 1
Share this question
or