[CLOSED] Loading External Page in Ext.Window is not working

  1. #1

    [CLOSED] Loading External Page in Ext.Window is not working

    Hi Ext.Net Team,

    I have a requirement to load the another asp page from ext.net page as child page (like javascript - showmodaldialog). i have tried with the following code but its not working. its opening a blank window.

    ASPX Page:

    <ext:Button ID="btnMainMenu" runat="server" Text="Main Menu" OnDirectClick="btnMainMenu_Click"
                                    StandOut="true">
                                </ext:Button>
    <ext:Window ID="windowOptimization" Hidden="true" runat="server" Collapsible="true"
            Icon="Application" Title="Optimization Criteria" AutoRender="false" Maximizable="true"
            Minimizable="false" MinHeight="550" MinWidth="800">
        </ext:Window>
    Code Behind Page (Inside Main Menu click event):

     ComponentLoader loader = new ComponentLoader();
     loader.Url = "mainmenu.asp";
     loader.Mode = LoadMode.Frame;
     loader.LoadMask.ShowMask = true;
     this.windowOptimization.Loader = loader;
    this.windowOptimization.Show();
    when execute the above code and clicking on "Main Menu" button, the window is opening but blank. i have tried replacing Url to http://www.ext.net but still its showing blank window.

    Kindly do the needful.
    Last edited by Daniil; Apr 03, 2013 at 3:52 PM. Reason: [CLOSED]
  2. #2
    Hello Tarun,

    Please define a Loader for the Window and call its LoadContent method.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Load(object sender, DirectEventArgs e)
        {
            this.Window1.LoadContent("http://ext.net");
            this.Window1.Show();
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Window 
                ID="Window1" 
                runat="server" 
                Hidden="true"
                Height="500" 
                Width="500">
                <Loader Mode="Frame" AutoLoad="false">
                    <LoadMask ShowMask="true" />
                </Loader>
            </ext:Window>
    
            <ext:Button 
                runat="server" 
                Text="Load" 
                OnDirectClick="Load" />
        </form>
    </body>
    </html>
  3. #3
    It is perfectly working. Many Thanks Daniil.


    Quote Originally Posted by Daniil View Post
    Hello Tarun,

    Please define a Loader for the Window and call its LoadContent method.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Load(object sender, DirectEventArgs e)
        {
            this.Window1.LoadContent("http://ext.net");
            this.Window1.Show();
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
    
            <ext:Window 
                ID="Window1" 
                runat="server" 
                Hidden="true"
                Height="500" 
                Width="500">
                <Loader Mode="Frame" AutoLoad="false">
                    <LoadMask ShowMask="true" />
                </Loader>
            </ext:Window>
    
            <ext:Button 
                runat="server" 
                Text="Load" 
                OnDirectClick="Load" />
        </form>
    </body>
    </html>
  4. #4
    Hi Daniil,

    Now i am facing a different issue. Now i am able to open a asp page in the ext window successfully. In my asp page, i have the following code written for accessing the parent form.

    opener.document.form1.action= "SendToOptimization.asp?RQ=" + ReqId + "&Sel=" + Sel + "&Cri=" + strOptimCriteria + "&Queue=Ins";
    opener.document.form1.method= "post";
    opener.document.form1.submit();
    In the above code, the object "opener.document" is throwing "null object" exception.

    Please let me know how i achieve this.
    Last edited by Tarun_Chand; Apr 04, 2013 at 6:56 AM.
  5. #5
    Probably, you should replace "opener" with "parent". Does it help?
  6. #6
    Yes, it worked. Many Thanks Daniil.

Similar Threads

  1. Loading External page to window Problem
    By alpeter in forum 1.x Help
    Replies: 0
    Last Post: Jan 17, 2013, 12:48 PM
  2. Load external web page : x-frame options
    By Yannis in forum 1.x Help
    Replies: 5
    Last Post: Feb 23, 2012, 3:32 AM
  3. Replies: 3
    Last Post: Jun 10, 2011, 1:17 PM
  4. Add a tab to tabpanel from external page
    By marcozzz in forum 1.x Help
    Replies: 0
    Last Post: Feb 16, 2010, 8:48 AM
  5. External window - problem with the event
    By Kaido in forum 1.x Help
    Replies: 2
    Last Post: Feb 05, 2009, 7:45 AM

Posting Permissions