[CLOSED] Load Dynamic External Url in Window

  1. #1

    [CLOSED] Load Dynamic External Url in Window

    Hello, here is my case: I have a GridPanel with some rows. I have a button and on click event i need to show a window with some url using params from the selected row. I can't make my window to load the url.

    Here is a sample for showing what i am doing:

    <%@ Page Language="C#" AutoEventWireup="true"  %>
    
    <%@ 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 id="Head1" runat="server">
        <title></title>   
        <script runat="server">
            
            public class Example
            {
                private int _ID;
                public int ID
                {
                    get { return _ID; }
                    set { _ID = value; }
                }
                
                private int _ResultId;
    
                public int ResultId
                {
                    get { return _ResultId; }
                    set { _ResultId = value; }
                }
    
                private DateTime _StartDate;
                public DateTime StartDate
                {
                    get { return _StartDate; }
                    set { _StartDate = value; }
                }
               
    
            }
            
            protected void btnDetalle_click(object sender, DirectEventArgs e)
            {
                RowSelectionModel sm = this.GridPan.SelectionModel.Primary as RowSelectionModel;
                if (sm.SelectedRow != null)
                {
                    string id = sm.SelectedRow.RecordID;
    
                    this.winLog.Show();
    
                    this.winLog.LoadContent(this.Page.ResolveUrl("log.aspx?exe_id=" + id));
    
                }
            }
            protected void Page_Load(object sender, EventArgs e)
            {
               if (!X.IsAjaxRequest)
               {
                   List<Example> list = new List<Example>();
                   Example item = new Example();
                   item.ID=1;
                   item.ResultId = 1;
                   item.StartDate = DateTime.Now;
                   list.Add(item);
                   
                   item = new Example();
                   item.ID=2;
                   item.ResultId = 1;
                   item.StartDate = DateTime.Now;
                   list.Add(item);
                   
                   item = new Example();
                   item.ID=3;
                   item.ResultId = 1;
                   item.StartDate = DateTime.Now;
                   list.Add(item);
                   
                   this.StoreJobs.DataSource =list ;
                   this.StoreJobs.DataBind();
               }
            }
            
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server">
            </ext:ResourceManager>
            
            <ext:GridPanel ID="GridPan" runat="server" Layout="FitLayout">
                <Store>
                    <ext:Store ID="StoreJobs" runat="server">
                        <Model>
                            <ext:Model ID="Model1"  runat="server" IDProperty="ID" >
                                <Fields>
                                    <ext:ModelField Name="StartDate" Type="Date" />                                
                                    <ext:ModelField Name="ResultId" Type="Int" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Store>
                <ColumnModel>
                    <Columns>
                        <ext:DateColumn Text="Fecha" Format="dd/MM/Y hh:mm:ss" DataIndex="StartDate" Width="250"   />                  
                        <ext:Column Text="Resultado" DataIndex="ResultId" Flex="1"  >                        
                        </ext:Column>                                              
                    </Columns>
                </ColumnModel>
                <SelectionModel  >
                    <ext:RowSelectionModel ID="RowSelectionModel1" runat="server" >
                        <Listeners>
                            <Select Handler="#{btnDetalle}.setDisabled(false);" />                    
                        </Listeners>
                    </ext:RowSelectionModel>
                </SelectionModel>
                <TopBar>
                    <ext:Toolbar ID="ToolOpciones" runat="server">
                        <Items>                        
                            <ext:Button ID="btnDetalle" Disabled="true" runat="server" Text="Detalle"  Icon="ApplicationViewDetail" OnDirectClick="btnDetalle_click">                       
                            </ext:Button>                                                     
                        </Items>
                    </ext:Toolbar>
                </TopBar>
            </ext:GridPanel>
            <ext:Window ID="winLog" runat="server" Hidden="true" Collapsible="false" Maximized="true" Minimizable="false" Modal="true"
                Title="Log" Layout="FitLayout" Closable="true">           
            </ext:Window>
        </form>
    </body>
    </html>
  2. #2
    Try this
    this.Panel1.LoadContent(new ComponentLoader() {            
              Url = "Url.aspx",            
              Mode = LoadMode.Frame        
    });
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    @Vladimir I tried your suggestion but after adding that code my window isn't showing.

    I wrote this but it's not working:
    this.winLog.LoadContent(new ComponentLoader() { Url = "log.aspx?exe_id=1", Mode = LoadMode.Frame });
    
    this.winLog.Show();
  4. #4
    Please add Loader to the window
    <Loader Mode="Frame" AutoLoad="false">                
                </Loader>
    Vladimir Shcheglov
    Sr. Developer
  5. #5
    Thanks @Vladimir! It's working ok now

Similar Threads

  1. Loading External page to window Problem
    By alpeter in forum 1.x Help
    Replies: 0
    Last Post: Jan 17, 2013, 1:48 PM
  2. Load external web page : x-frame options
    By Yannis in forum 1.x Help
    Replies: 5
    Last Post: Feb 23, 2012, 4:32 AM
  3. Replies: 3
    Last Post: Jun 10, 2011, 2:17 PM
  4. Load External Website into an
    By Kamal in forum 1.x Help
    Replies: 3
    Last Post: Jul 25, 2009, 7:16 AM
  5. External window - problem with the event
    By Kaido in forum 1.x Help
    Replies: 2
    Last Post: Feb 05, 2009, 8:45 AM

Tags for this Thread

Posting Permissions