[CLOSED] Get control in Parent Page

  1. #1

    [CLOSED] Get control in Parent Page

    Hi, I have the next problem, I can't to get to reference to control "Window" from a Parent Page in Code Begind, I have two page "Default.aspx" and "LoadPanel.aspx", in the Default.aspx I have a Button with a Click DirectEvent that, It load the page "LoadPanel.aspx" in the Load propertie of "Default.aspx" page. In the "LoadPanel.aspx" I have a Button with Click DirectEvent that, I want to reference the control Window in the "Default.aspx".

    Page Default.aspx:

            protected void Button1_Click(object sender, DirectEventArgs e)
            {
                pCentro.LoadContent("LoadPanel.aspx");
            }
    
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
            <ext:Panel
                ID="pCentro"
                runat="server"
                Height="300"
                Title="Title">
                <Items>
                    <ext:Button ID="Button1" runat="server" Text="Submit">
                        <DirectEvents>
                            <Click OnEvent="Button1_Click" />
                        </DirectEvents>
                    </ext:Button>
                </Items>
                <Loader ID="lCentro" runat="server" Mode="Frame" AutoLoad="False">
                    <LoadMask ShowMask="true" Msg="Cargando..." />
                </Loader>
            </ext:Panel>
        
        
            <ext:Window
                ID="wEmergente"
                runat="server"
                Icon="Application"
                Hidden="true"
                Modal="true"
                Padding="5"
                Resizable="False">
                <Loader ID="lEmergente" runat="server" Mode="Frame" AutoLoad="false">
                    <LoadMask ShowMask="true" Msg="Cargando..." />
                </Loader>
            </ext:Window>
    Page LoadPanel.aspx

    
            protected void Button1_Click(object sender, DirectEventArgs e)
            {
                //This code don't working
                Ext.Net.Window wEmergente = (Ext.Net.Window)Parent.FindControl("wEmergente");
    
            }
    
            <ext:ResourceManager ID="ResourceManager1" runat="server" />
    
            <ext:Button ID="Button1" runat="server" Text="Submit">
                <DirectEvents>
                    <Click OnEvent="Button1_Click" />
                </DirectEvents>
            </ext:Button>
    Last edited by Daniil; Oct 29, 2013 at 9:34 AM. Reason: [CLOSED]
  2. #2
    Hi @osef,

    A parent page and a child (iframe) one have no access to each other in code behind, they are individual Pages.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @osef,

    A parent page and a child (iframe) one have no access to each other in code behind, they are individual Pages.
    Thank you Daniil, so, How Can I do to load "http://www.ext.net" page to control window in "Default.aspx" from Button Click of "LoadPage.aspx"? with other method.
  4. #4
    On the child page, you can do the following via JavaScript:
    parentAutoLoadControl.load("new URL");
    The "parentAutoLoadControl" is a reference to the Window instance.
  5. #5
    Quote Originally Posted by Daniil View Post
    On the child page, you can do the following via JavaScript:
    parentAutoLoadControl.load("new URL");
    The "parentAutoLoadControl" is a reference to the Window instance.
    Thank you Daniil, but, It is rendering inside "pCentro" of "Default.aspx", I want inside "wEmergente" control of "Default.aspx", How Can I do this?

    My code in the Button1 in LoadPanel.aspx

            <ext:Button ID="Button1" runat="server" Text="Submit">
                <Listeners>
                    <Click Handler="parentAutoLoadControl.load('http://www.ext.net');" />
                </Listeners>
            </ext:Button>
    Click image for larger version. 

Name:	PanelNoWindow.png 
Views:	16 
Size:	86.7 KB 
ID:	7138
  6. #6
    Hello!

    Try the following:

    <ext:Button ID="Button1" runat="server" Text="Submit" Handler="
            window.parent.App.wEmergente.load('http://ext.net');
            window.parent.App.wEmergente.show();
            ">
        </ext:Button>
  7. #7
    Quote Originally Posted by Baidaly View Post
    Hello!

    Try the following:

    <ext:Button ID="Button1" runat="server" Text="Submit" Handler="
            window.parent.App.wEmergente.load('http://ext.net');
            window.parent.App.wEmergente.show();
            ">
        </ext:Button>
    Thank you Baidaly this is working.

Similar Threads

  1. Replies: 0
    Last Post: Jan 11, 2013, 1:57 AM
  2. Replies: 2
    Last Post: Jan 09, 2013, 12:52 AM
  3. Replies: 2
    Last Post: Nov 15, 2012, 12:52 AM
  4. Replies: 1
    Last Post: Feb 03, 2012, 2:36 PM
  5. Replies: 5
    Last Post: Aug 04, 2009, 10:49 AM

Tags for this Thread

Posting Permissions