Apr 06, 2009, 12:19 PM
[CLOSED] Open a Window in a parent page
I everybody,
I'm having some troubles trying to open a parent ext:window from an iframe ext:window.
I explain better my problem:
I Have 2 windows in my Test.aspx page:
The first one auto load the page Test2.apsx using IFrame mode.
The Second one should be open pressing a button inside my Test2.aspx contained in the first window.
Now...in some way i made it working in IE but FF throw me an error.
Check the code.
Test.aspx
Does someone know why FF gives me an error "for free" or anyone know a better way to do what i'm trying to do.
Thanks a lot,
I'm having some troubles trying to open a parent ext:window from an iframe ext:window.
I explain better my problem:
I Have 2 windows in my Test.aspx page:
The first one auto load the page Test2.apsx using IFrame mode.
The Second one should be open pressing a button inside my Test2.aspx contained in the first window.
Now...in some way i made it working in IE but FF throw me an error.
Check the code.
Test.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs"
Inherits="Test" %>
<!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:ScriptManager ID="CooliteSM" runat="server" />
<ext:Window ID="WndTest" runat="server" Showonload="true" Title="Iframe Window"
Width="800" Height="600">
<AutoLoad Mode="IFrame" Url="Test2.aspx" />
</ext:Window>
<ext:Label ID="lblTest" runat="server" Text="Caricato" />
<ext:Window ID="WndProva" runat="server" Showonload="false" Title="APRITI"
Width="800" Height="600">
<Body>
<p>
HELLO!
</p>
</Body>
</ext:Window>
<ext:Button ID="btnApri" runat="server" Text="Apri">
<Listeners>
<Click Handler="#{WndProva}.show();" />
</Listeners>
</ext:Button>
</form>
</body>
</html>
Test2.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>
</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="CooliteSM" runat="server" />
<ext:Button ID="BtnRedirectMain" runat="server" Text="Redirect" Icon="LinkGo">
<Listeners>
<Click Handler="OpenWindow();" />
</Listeners>
</ext:Button>
<script type="text/javascript">
function OpenWindow() {
var btn = window.parent.document.getElementById("btnApri");
btn.click();
}
</script>
</form>
</body>
</html>
Does someone know why FF gives me an error "for free" or anyone know a better way to do what i'm trying to do.
Thanks a lot,