This is a migrated thread and some comments may be shown as answers.

[Solved] Cannot get ref to RadWindowManager on pages with an IFrame

4 Answers 127 Views
Window
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 22 Feb 2008, 11:39 PM
Hi, I've got a RadWindowManager control sited on a page with an IFrame. I have a javascript function to show a dialog window but whichever method i use (radopen, GetRadWindowManager etc) it always fails with RadWindowManager undefined. If I take the Iframe off it works fine. Can you help with this problem please.

Thanks in advance,

John

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 25 Feb 2008, 02:20 PM
Hello John,

Can you please provide more information about the exact setup that you are having? Where is the function that you use to open the window and how exactly are you opening that RadWindow?



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John
Top achievements
Rank 1
answered on 25 Feb 2008, 02:38 PM
Hi, basically I just took one of your samples and trimmed it down and added an iframe. The aspx code is :

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="WebForm1.aspx.cs" Inherits="ModalDialog.RadWindow.WebForm1" %>

<%

@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!

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">

</

head>

<

body class="BODY">

<form id="form1" runat="server">

<

asp:ScriptManager id="ScriptManager"

runat

="server"/>

<script>

function OpenWindow(name)

{

//neither method works....

//var manager = GetRadWindowManager();

//var wnd = manager.open("http://www.google.com", name);

var wnd = window.radopen("http://www.google.com", name);

wnd.set_Modal(

true);

wnd.setSize(400,400);

wnd.show();

return false;

}

</script>

<button onclick = "return OpenWindow('test')" id="button2">Open with radopen</button>

<telerik:radwindowmanager runat="server" ID="RadWindowManager1">

<Windows>

</Windows>

</telerik:radwindowmanager>

<iframe src="http://www.telerik.com" id="jr"/>

</form>

</

body>

</

html>



There's nothing in the code behind class. The call to radopen fails with an undefined reference to the RadWindowManager. If I remove the iframe, it works fine.

Many thanks,

John Rhodes

0
George
Telerik team
answered on 25 Feb 2008, 03:29 PM
Hello John,

The problem is not related to our controls and it comes from improper declaration of the iframe element. The right way iframe object should be declared is with its closing tag:

<iframe></iframe>

The provided declaration in your case stops any scripts and content after the declaration. You can have a try to put simple alert JavaScript immediately after the iframe and you will not see it to run.

Please modify your iframe declaration in the shown method above and it should be fine.


All the best,
George
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John
Top achievements
Rank 1
answered on 25 Feb 2008, 03:43 PM
Thanks George, that worked fine!

That's something I learnt today :-)

John
Tags
Window
Asked by
John
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
John
Top achievements
Rank 1
George
Telerik team
Share this question
or