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
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.
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.
Svetlina Anati
the Telerik team
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?
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
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....
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
Thank you so much for above solution ....
Its working....
Varun