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

[Solved] RadAjaxPanel iframe javascript error

2 Answers 107 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
M K
Top achievements
Rank 1
M K asked on 03 Jul 2009, 08:57 AM
hi,

I have a very simple aspx page that contains a radAjaxpanel control inwhich I have an Iframe.
When the page loads for the first time, I can access the iframe.document object via javascript and all works fine. after the first partial postback done by the AjaxPanel, I cannot access the iframe.document ojbect via javascript and it gives me "null" instead!
If I remove the AjaxPanel it works perfectly.

Here is the .aspx and .vb contents.

--------------ASPX-----------------

<%

@ Page Language="VB" AutoEventWireup="false" CodeFile="temp.aspx.vb" Inherits="Admin_temp" %>

 

<%

 

@ Register assembly="Telerik.Web.UI, Version=2009.1.402.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

 

<!

 

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>Untitled Page</title>

 

 

 </

 

head 

 

 

<body>

 

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

 

<div>

 

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">

 

</telerik:RadScriptManager>

 

</div>

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px" width="300px">

 

<asp:Button ID="Button1" runat="server" Text="Button" />

 

<input ID="Button2" type="button" value="button" onclick="alert(myframe);alert(myframe.document);" /><br />

 

<iframe id="myframe" name="myframe" runat="server"></iframe>

 

</telerik:RadAjaxPanel>

 

</form>

</

 

body>

 

</

 

html>

 

 

--------------END ASPX-----------

---------------CODE BEHIND-----------------

Partial

 

Class Admin_temp

 

 

Inherits System.Web.UI.Page

 

 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Button1.Text = Now

 

End Sub

 

 

 

Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender

myframe.Attributes(

"src") = "default.aspx?time=" & Now

 

 

End Sub

 

End

 

Class

 

 

---------------END CODE BEHIND-----------------

I hope you can assist me ASAP, Thanks.

2 Answers, 1 is accepted

Sort by
0
M K
Top achievements
Rank 1
answered on 03 Jul 2009, 10:38 AM
I forgot mention that this problem only happens with Firefox; IE and Safari work fine.
Thanks,
0
Iana Tsolova
Telerik team
answered on 06 Jul 2009, 03:14 PM
Hi M K,

I followed your description and prepared a sample project attached to this post. It is working as expected on my side, can you tell how it works on your end and what differs in your case?

Looking forward your reply, Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Ajax
Asked by
M K
Top achievements
Rank 1
Answers by
M K
Top achievements
Rank 1
Iana Tsolova
Telerik team
Share this question
or