i am using RadWindow in my Portal and i have few text box on my Radwindow and one Image Button..... i want to know that how to Close my Radwindow and Redirect page to parent page when i click on Image button which is on Radwindow ..can any one help me???
5 Answers, 1 is accepted
Try the following.
ASPX:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> <Windows> <telerik:RadWindow ID="RadWindow1" runat="server"> <ContentTemplate> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/img.gif" OnClick="ImageButton1_Click"/> </ContentTemplate> </telerik:RadWindow> </Windows></telerik:RadWindowManager><asp:Button ID="btn" runat="server" Text="open" OnClientClick="OnClientClick(); return false;" /><script type="text/javascript">function OnClientClick() { var win = window.radopen(null, "RadWindow1"); }</script>protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Response.Redirect("ParentPage.aspx"); }-Shinu.
In case you have used the approach with a ContentTemplate as Shinu has used and your user control is inside that template you can use the very same code. As to adding the parameter, you can pass it as a query string value in a similar manner to that:
Response.Redirect("ParentPage.aspx?myParam=customParam");
In case you are using a NavigateUrl and you have a separate page, you should execute a script from the server to change the top of the frame tree or you should use frame buster script code in the page you redirect to. A frame buster script which will work is the following one:
if (window != window.top) window.top.location.href = window.location.href;
In case you need further assistance, please provide more details of your setup and best - a simple reproduction demo (no need for complex custom logic, only the RadWindow setup/configuration.main/content page and a button) along with detailed explanations and we will help you achieve what you need.
Greetings,
Svetlina Anati
the Telerik team
Thanks for your Reply
i m using Ascx page as my master page Design and Coding
Design
<telerik:RadWindow ID="RadWindow1" runat="server" AutoSize="True" Animation="Resize" AnimationDuration="100"></telerik:RadWindow>Code
If Not IsPostBack Then
RadWindow1.VisibleOnPageLoad = True RadWindow1.Visible = True RadWindow1.Enabled = True RadWindow1.EnableShadow = True RadWindow1.NavigateUrl = "StartTest.aspx?value=" & UserName & "-" & TopicID & "-" & CatID & "-" & EmployeeID & "-" & TestID RadWindow1.VisibleTitlebar = False RadWindow1.ReloadOnShow = False RadWindow1.DestroyOnClose = True 'RadWindow1.Behaviors = WindowBehaviors.Pin End IfGenerally ASCX files are not served, as they are user controls and can exist only as a part of an aspx page. This means that you cannot redirect directly to a user control, but to a page that contains it. How to do this was explained in the previous reply.
As for blocking the page behind the RadWindow - you can simply use its Modal property and set it to true.
I can also suggest that you examine this thread on opening the RadWindow from the server.
All the best,
Marin
the Telerik team