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

close radwindow inside...

3 Answers 100 Views
Window
This is a migrated thread and some comments may be shown as answers.
aykut
Top achievements
Rank 1
aykut asked on 07 Dec 2012, 03:27 PM
Dear friends, I found may threads but none of them worked for me. what I'm trying to do is:

main page (with masterpage) will call page1 in radwindow
o page1, I need to close radwindow and sense its closed so I'll go on...

problem is, I could not find main page's radwindow control and cannot close it. can you help me ?

on main page I open as:
<telerik:radwindowmanager id="RadWindowManager1" reloadonshow="true" runat="server">
        <Windows>
            <telerik:RadWindow runat="server" Width="600px" Height="550px" VisibleStatusbar="true" Style="z-index: 10000;"
                ID="ExplorerWindow" Modal="true" Behaviors="Default" ShowContentDuringLoad="true" RegisterWithScriptManager="true" >
            </telerik:RadWindow>
        </Windows>
    </telerik:radwindowmanager>
 
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    ExplorerWindow.NavigateUrl = "page1.aspx"
    ExplorerWindow.VisibleOnPageLoad = True
End Sub

I dont know howto find radwindow from the page inside radwindow.

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
 
    ' close window
 
End Sub

there's nothing in pages as this is isolated test application. just trying to close radwindow.
thanks...

3 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Dec 2012, 04:11 PM
Hello,

This demo shows how to do this: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx. The right hand side RadWindow loads a Dialog.aspx page that shows the GetRadWindow() function. You can execute the closing logic from the server as explained here: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-javascript-from-server-side.html.




Greetings,
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
aykut
Top achievements
Rank 1
answered on 07 Dec 2012, 04:53 PM
okay, thanks. I make it run.  can you tell me how can I close radwindow from the page that opens it ?

in below example, button1 opens radwindow. I want whatever radwindow shows, close radwindow within main page. I couldn't run thins script for hours, sorry. couldn't get radwindow object. the script below doesnot close radwindow if its in main page.

with below code button1 opens radwindow, buttonclose closes it but it shows up again. think its realted with VisibleOnPageLoad = True/false definition but when I set VisibleOnPageLoad = false  inButton1_click event, window never shows up.

    <script type="text/javascript">
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow)
                oWindow = window.RadWindow;    
            else if (window.frameElement.radWindow)
                oWindow = window.frameElement.radWindow;    
            return oWindow;
        }
        function Close() {
            GetRadWindow().Close();
        }
    </script>
 
    <telerik:RadWindowManager ID="RadWindow1" ReloadOnShow="true" runat="server">
            <Windows>
                <telerik:RadWindow  runat="server" Width="600px" Height="550px" VisibleStatusbar="true" Style="z-index: 10000;"
                    ID="ExplorerWindow" Modal="false" Behaviors="Default" ShowContentDuringLoad="true" RegisterWithScriptManager="true">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
    <br />
    MAIN SITE<br />
    <br />
    <asp:Button ID="Button1" runat="server" Text="Button" />
 
    <asp:Button ID="ButtonClose" runat="server" Text="asdfasdf" OnClientClick="Close();"/>
 
button1 openes radwindow:
    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        ExplorerWindow.NavigateUrl = "page1.aspx"
        ExplorerWindow.VisibleOnPageLoad = True
    End Sub
0
Princy
Top achievements
Rank 2
answered on 10 Dec 2012, 06:04 AM
Hi,

After inspecting your code, I cannot find the click event attached to the button. Make sure that you have attached the event.
aspx:
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

Thanks,
Princy.
Tags
Window
Asked by
aykut
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
aykut
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or