[CLOSED] [1.0] IE8 blocks window.open when inside a DirectMethod

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] [1.0] IE8 blocks window.open when inside a DirectMethod

    Hi,

    I am having an issue with DirectMethod that calls window.open. Consider the code below. The first link works OK, window gets opened. But if I use a DirectMethod and call window.open, IE blocks it. Please let me know if theres a work around for this issue.

    
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
            }
        }
    
        [DirectMethod]
        public static string GetURL()
        {
            return "http://google.com";
        }
        
        
        
    </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>Simple Array Grid - Ext.NET Examples</title>
        <link href="../../../../resources/css/examples.css" rel="stylesheet" type="text/css" />    
    
        <ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" />
    
        <script type="text/javascript">
    
            function openYahoo() {
                var width = 800;
                var height = 600;
                var left = Math.floor((screen.availWidth - width) / 2);
                var top = Math.floor((screen.availHeight - height) / 2);
                var windowFeatures = "width=" + width + ",height=" + height +
                ",menubar=no,toolbar=no,scrollbars=no,resizable=no," +
                "left=" + left + ",top=" + top +
                "screenX=" + left + ",screenY=" + top;
                child1 = window.open("http://yahoo.com", "winYahoo", windowFeatures);
    
            }
    
            function openGoogle() {
                Ext.net.DirectMethods.GetURL({ success: function (result) {
                    var width = 800;
                    var height = 600;
                    var left = Math.floor((screen.availWidth - width) / 2);
                    var top = Math.floor((screen.availHeight - height) / 2);
                    var windowFeatures = "width=" + width + ",height=" + height +
                ",menubar=no,toolbar=no,scrollbars=no,resizable=no," +
                "left=" + left + ",top=" + top +
                "screenX=" + left + ",screenY=" + top;
                    child1 = window.open(result, "winGoogle", windowFeatures);
                } });
            }
        </script>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        
        <a href="#" onclick="openYahoo(); "> Open Yahoo</a>
        <br />
        <a href="#" onclick="openGoogle(); ">Open Google</a>
    </body>
    </html>
    Looking forward to your response.
    Last edited by Daniil; Jun 20, 2011 at 4:38 PM. Reason: [CLOSED]

Similar Threads

  1. [CLOSED] DirectMethod is not working inside window.onbeforeunload for Firefox
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jul 14, 2011, 10:16 AM
  2. Replies: 1
    Last Post: Nov 11, 2010, 1:04 AM
  3. Replies: 9
    Last Post: Oct 07, 2010, 6:27 PM
  4. [OPEN] HtmlEditor inside ext:window
    By methode in forum Bugs
    Replies: 10
    Last Post: Jan 18, 2009, 2:59 AM

Posting Permissions