[CLOSED] Open parent window from child page using DirectEvent?

  1. #1

    [CLOSED] Open parent window from child page using DirectEvent?

    Hello,

    Is it possible to set the autoload.url and open the parent window from child page using DirectEvent? Any help would be much appreciated.
    Thanks.
    Last edited by Daniil; Jun 20, 2012 at 10:55 AM. Reason: [CLOSED]
  2. #2
    Hi,

    No way, an iframe page has no access to its parent page on server. So, only via JavaScript.

    But you can generate during DirectEvent any JavaScript to be executed on client.

    Here is the simple example.

    Example Parent Page
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <!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>Ext.NET Example</title>
    
        <script type="text/javascript">
            var load = function (url) {
                Window1.show();
                Window1.load({
                    url : url
                });
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Panel runat="server" Width="4000" Height="100">
                <AutoLoad Mode="IFrame" Url="Test.aspx" />
            </ext:Panel>
    
            <ext:Window 
                ID="Window1" 
                runat="server" 
                Height="400" 
                Width="400" 
                Hidden="true">
                <AutoLoad Mode="IFrame" ManuallyTriggered="true" ShowMask="true" />
            </ext:Window>
        </form>
    </body>
    </html>
    Example Child Page
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Load(object sender, DirectEventArgs e)
        {
            X.Js.Call("parent.load", "http://ext.net");
        }
    </script>
    
    <!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>Ext.NET Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
            <ext:Button 
                runat="server" 
                Text="Load the parent window from the iframe" 
                OnDirectClick="Load" />
        </form>
    </body>
    </html>

Similar Threads

  1. Replies: 1
    Last Post: May 29, 2012, 8:51 AM
  2. Replies: 7
    Last Post: Feb 09, 2012, 11:17 AM
  3. Replies: 1
    Last Post: Feb 03, 2012, 2:36 PM
  4. [CLOSED] Child page to parent page call
    By majestic in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 05, 2010, 5:41 PM
  5. [CLOSED] Open a Window in a parent page
    By Immobilmente in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 07, 2009, 4:10 AM

Tags for this Thread

Posting Permissions