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

Dynamic iFrame Height in RadAjaxPannel

5 Answers 175 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Nahid
Top achievements
Rank 1
Nahid asked on 29 Sep 2010, 03:40 PM
Hello,
I am developing a web application with ASP.NET 3.5 with C# and Telerik Ajax Control. I have a iFrame in my master page. Application load other pages in iFrame dynamically and iFrame height adjust the dynamically when page load. I uses RadScriptManager , RadAjaxPannel, RadAjaxLoadingPannel in my page. The problem is when "call back" the page, iFrame height not adjust dynamically.


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head" runat="server">
    <title></title>
   
   <script type="text/javascript" language="JavaScript">
 
        
       function setSize(elem) {
           var the_height;
 
           the_height = elem.contentWindow.document.body.scrollHeight;
           elem.height = the_height; // Its works fine in IE, Chrome, Safari but not work in FF and opera
 
 
       }
       
        
 
</script>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
     
</head>
<body  id="Page_Master"  runat="server"  >
 
    <form id="formMasterPage" method="post" runat="server">
      
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  AsyncPostBackTimeout="500">
    </telerik:RadScriptManager>
    
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Height="100%" Width="100%"   >
            
     
    <div id="MainPage">
       
        <div class="Header">
             
        </div>
         
        <div id="ContentHolder">
            <div id="Content">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
                 
                <iframe id="IFrameMaster" name="IFrameMaster"  scrolling="auto" width="998px"  style=" min-height:500px;"  allowtransparency="true"   frameborder="0" runat="server" >
                </iframe>
              
                 
                 
            </div>
        </div>
        <div id="Footer">
             
        </div>
    </div>
     </telerik:RadAjaxPanel>
    
    </form>
 
</body>
</html>


Serverside Code :
// This code used in Page_Load Method and other methods depends on condition.
IFrameMaster.Attributes["src"] = "UIHome.aspx";
// This line used only Page_Load Method
IFrameMaster.Attributes.Add("onload", "javascript:setSize(this)");

How can I set iFrame height dynamic.

Thanks

5 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 29 Sep 2010, 03:55 PM
Hi Md Nasir,

Your question does not seem related to RadControls, but try one or both of these suggestions. Use

elem.style.height    instead of    elem.height

the_height + "px"     instead of     the_height


Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nahid
Top achievements
Rank 1
answered on 30 Sep 2010, 08:45 AM
Hi Dimo ,
Thanks for your replay. The code you provide there is no change of page height. If I write EnableAjax="False" in my RadAjaxPanel in my page then page height change dynamically . How can I manage dynamic height with using Ajax (EnableAjax="True") ?

Thanks
Md Nasir Uddin
0
Dimo
Telerik team
answered on 30 Sep 2010, 09:39 AM
Hi Md Nasir,

Can you provide a full demo, which shows your AJAX settings?

Greetings,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nahid
Top achievements
Rank 1
answered on 12 Oct 2010, 09:49 AM
Hi Dimo,
Thanks for your replay. But how can I send you  my demo project ?

Thanks
Md Nasir Uddin
0
Dimo
Telerik team
answered on 12 Oct 2010, 10:51 AM
Hi Md Nasir,

Demos can be attached in formal support tickets sent from your Telerik account:

http://www.telerik.com/account/support-tickets/new-support-ticket.aspx

Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Ajax
Asked by
Nahid
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Nahid
Top achievements
Rank 1
Share this question
or