Jun 17, 2011, 11:59 PM
[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.
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]