[CLOSED] Open a Window in a parent page

  1. #1

    [CLOSED] Open a Window in a parent page

    I everybody,
    I'm having some troubles trying to open a parent ext:window from an iframe ext:window.
    I explain better my problem:

    I Have 2 windows in my Test.aspx page:
    The first one auto load the page Test2.apsx using IFrame mode.
    The Second one should be open pressing a button inside my Test2.aspx contained in the first window.
    Now...in some way i made it working in IE but FF throw me an error.

    Check the code.

    Test.aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs"
    Inherits="Test" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head runat="server">
        <title>
        </title>
    </head>
    
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="CooliteSM" runat="server" />
            <ext:Window ID="WndTest" runat="server" Show&#111;nload="true" Title="Iframe Window"
            Width="800" Height="600">
                <AutoLoad Mode="IFrame" Url="Test2.aspx" />
            </ext:Window>
            <ext:Label ID="lblTest" runat="server" Text="Caricato" />
            <ext:Window ID="WndProva" runat="server" Show&#111;nload="false" Title="APRITI"
            Width="800" Height="600">
                
                <Body>
                    <p>
                        HELLO!
                    </p>
                </Body>
            </ext:Window>
            <ext:Button ID="btnApri" runat="server" Text="Apri">
                <Listeners>
                    <Click Handler="#{WndProva}.show();" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    
    </html>
    Test2.aspx
    <%@ Page Language="C#" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
        
        <head runat="server">
            <title>
            </title>
        </head>
        
        <body>
            <form id="form1" runat="server">
                <ext:ScriptManager ID="CooliteSM" runat="server" />
                
                    <ext:Button ID="BtnRedirectMain" runat="server" Text="Redirect" Icon="LinkGo">
                        <Listeners>
                            <Click Handler="OpenWindow();" />
                        </Listeners>
                    </ext:Button>
                
    
                <script type="text/javascript">
                    function OpenWindow() {
    
                        var btn = window.parent.&#100;ocument.getElementById("btnApri");
    
                        btn.click();
    
                    }
                </script>
            </form>
        </body>
    </html>

    Does someone know why FF gives me an error "for free" or anyone know a better way to do what i'm trying to do.
    Thanks a lot,

  2. #2

    RE: [CLOSED] Open a Window in a parent page

    Hi,

    Try to call the following javascript code from iframe page
    parent.window.WndProva.show();
    *


    Please note that WndProva must has ID=ClientID in this case. If note then you can set IDMode="Static" for this window


  3. #3

    RE: [CLOSED] Open a Window in a parent page

    Hi Vladsh,
    Thank you it perfectly works in IE and FF.

    Mark this as Solved,
    Thanks again,

Similar Threads

  1. [CLOSED] Open parent window from child page using DirectEvent?
    By tjshin in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jun 15, 2012, 2:25 PM
  2. [CLOSED] open window out of its parent
    By imaa in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 26, 2011, 6:07 AM
  3. Open window out the parent
    By Egale in forum 1.x Help
    Replies: 8
    Last Post: Jun 22, 2011, 11:45 AM
  4. [CLOSED] Open window in parent
    By paulc in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 16, 2010, 9:54 AM
  5. [CLOSED] ext:ImageButton, open URL in parent window
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 11, 2009, 11:39 AM

Posting Permissions