Closing Window from child page

  1. #1

    Closing Window from child page

    Hi.

    I have the following situation:

    - MasterPage
    - ParentPage with a ext.net Window:

    <ext:Window ID="Richieste_window"   runat="server" Layout="FitLayout" Hidden="true" Modal="true"  Width="800" Height="560"  >
         <Loader runat="server" Url="Child_page.aspx"  Mode="Frame" AutoLoad="false"  > 
             <LoadMask  ShowMask="true"  Msg="Caricamento in corso..."  AutoDataBind="false"></LoadMask>
             
         </Loader>
         <Listeners>
             <Close Handler="Close_actions();"></Close>
         </Listeners>
     </ext:Window>
    - Child Page (NOS_chisura_prima_richiesta.aspx) loaded by window loader

    How can I close/hide Window (Richieste_window) from childpage (Child_page.aspx) codebehind?

    Thanks.
    Stefano
  2. #2
    The .parent property will get you an instance of the Parent document. Something like the following should work.

    Example

    this.parent.App.Richieste_window.close();
    Geoffrey McGill
    Founder
  3. #3
    Hi.
    Thanks for your answer.
    Unfortunately the proposed syntax produces a compilation errror (VS2012, Ext.net 2.4). App is not recognized as a valid attribute for this.Parent (please see attachment).


    Do I have to set, within the child page, any parent page property?

    Actually the only link between the two pages (parent and child) is the loader of the window object (in the parent aspx file):
    <Loader runat="server" Url="NOS_chiusura_prima_richiesta.aspx"  Mode="Frame" AutoLoad="false"  >

    Thanks.
    Stefano
    Click image for larger version. 

Name:	Cattura.JPG 
Views:	12 
Size:	24.7 KB 
ID:	7352
  4. #4
    Hello!

    You should use it on the client-side. It's JavaScript code.
  5. #5
    Hi.
    Thanks for Your answer.

    I solved calling a codebehind function of parent page (I tried to close directly the Window Item but I received a "not defined object" error).

    In the following the working solution
    Regards.

    Stefano


    Parent page codebedind:

     [DirectMethod(Namespace = "Gestione")]
            public void chiudi_richieste()
            {
                Richieste_window.Close();
            }
    Child Javascript code:

       function chiudi_richieste_window()
         {
             parent.Gestione.chiudi_richieste();
         }
  6. #6
    Thank you for your update!

Similar Threads

  1. Replies: 2
    Last Post: Apr 18, 2013, 2:49 AM
  2. [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
  3. [CLOSED] Problem: Closing Maximized Window will loose parent window scrollbar
    By tlfdesarrollo in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 19, 2012, 8:51 PM
  4. Replies: 7
    Last Post: Feb 09, 2012, 11:17 AM
  5. Replies: 1
    Last Post: Feb 03, 2012, 2:36 PM

Posting Permissions