May 08, 2012, 2:40 PM
[CLOSED] [1.3] Window.close() causing 'Microsoft JScript runtime error: 'Ext' is undefined' error when called from an IFRAME
Hi, I'm creating a new window and trying to invoke the close method of that window from the resulting IFRAME using the close method on the parentAutoLoadControl object. When doing this I'm getting the 'Microsoft JScript runtime error: 'Ext' is undefined' error. When I call the hide method I do not have issues. I've also tried closing the window down from the parent and things are fine so I can only assume this is something to do with killing of the window from which the click originates.
This appears to function correctly in Chrome, I haven't tested FF but isn't working in IE9. I'm also using Ext.net v1.3
I've included code for both the Parent and Child below. Any help would be great.
Thanks,
Gav
Parent Page
This appears to function correctly in Chrome, I haven't tested FF but isn't working in IE9. I'm also using Ext.net v1.3
I've included code for both the Parent and Child below. Any help would be great.
Thanks,
Gav
Parent Page
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ClientSideWindowLoader.aspx.vb"
Inherits="ASPSandbox.ClientSideWindowLoader" %>
<%@ 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 runat="server">
<title></title>
<script type="text/javascript">
function loadWindow() {
var win = new Ext.Window({
width: 400,
id: 'autoload-win',
height: 300,
autoLoad: {
url: 'ChildContent.aspx',
mode: 'iframe'
},
title: 'test'
});
win.show();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" DirectMethodNamespace="Server">
</ext:ResourceManager>
<ext:Button ID="Button1" runat="server" Text="Create Window">
<Listeners>
<Click Fn="loadWindow" />
</Listeners>
</ext:Button>
<ext:Button ID="Button2" runat="server" Text="Close Window">
<Listeners>
<Click Handler="Ext.WindowMgr.get('autoload-win').close();" />
</Listeners>
</ext:Button>
</form>
</body>
</html>
Child Page<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="ChildContent.aspx.vb"
Inherits="ASPSandbox.ChildContent" %>
<%@ 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 runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server">
</ext:ResourceManager>
<ext:Button ID="Button2" runat="server" Text="Close Me">
<Listeners>
<Click Handler="parentAutoLoadControl.close();/*parentAutoLoadControl.hide();*/" />
</Listeners>
</ext:Button>
</form>
</body>
</html>
Last edited by Daniil; May 08, 2012 at 3:37 PM.
Reason: [CLOSED]