ext:window.Show from VB code behind

  1. #1

    ext:window.Show from VB code behind

    I'm having a problem getting the ext:Window to show a site as an iFrame load.

    The window exists and shows on it's appropriate event, however it doesn't show any contents - always empty.

    The HintURL variable is a formatted URL captured into a string where other vars are tacked on to form a the query string for the window's contents. If I copy and past the value of HintURL into a browser it appears correctly, so I'm fairly confident that the HinURL variable is correct.

    Any ideas on what I'm missing?

    Me.RiskHelper.Width = Unit.Pixel(800)
    Me.RiskHelper.Height = Unit.Pixel(400)
    Me.RiskHelper.AutoLoad.Url = HintURL
    Me.RiskHelper.AutoLoad.Mode = LoadMode.IFrame
    Me.RiskHelper.Title = Me.GridRiskName.Trim.ToString
    Me.RiskHelper.ShowOnLoad = False
    Me.RiskHelper.Show()
    Thanks,

    Rick
  2. #2

    RE: ext:window.Show from VB code behind

    Hi Rick,

    I think you just need to ensure the Window is added to the Controls Collection before .Show is called.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            Window win = new Window();
    
            win.Width = Unit.Pixel(800);
            win.Height = Unit.Pixel(400);
            win.AutoLoad.Url = "http://www.google.com";
            win.AutoLoad.Mode = LoadMode.IFrame;
            win.Title = "Title";
            
            // Add Window to Controls Collection before .Show() is called.
            this.Form.Controls.Add(win);
            
            // Neither of the following lines are required if intention is
            // to "show" the Window on initial Page_Load. 
            // win.ShowOnLoad = false;
            // win.Show();
        }
    </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 id="Head1" runat="server">
        <title>Coolite Toolkit Example</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
        </form>
    </body>
    </html>
    Hope this helps.

    Geoffrey McGill
    Founder

Similar Threads

  1. Windows 2007 - window.show not working
    By Tbaseflug in forum 1.x Help
    Replies: 0
    Last Post: Apr 16, 2010, 3:42 PM
  2. [CLOSED] indow.Show and Hide
    By sharif in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Feb 23, 2010, 9:06 AM
  3. [CLOSED] Error on window.Show
    By fabiomarcos in forum 1.x Help
    Replies: 3
    Last Post: Nov 20, 2008, 8:28 AM
  4. [CLOSED] window.Show() not working...
    By fabiomarcos in forum 1.x Help
    Replies: 3
    Last Post: Nov 19, 2008, 3:24 PM
  5. window.Show
    By MrMp3 in forum 1.x Help
    Replies: 3
    Last Post: Apr 28, 2008, 4:55 PM

Posting Permissions