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.