Dynamic iFrame Height in RadAjaxPannel

6 posts, 0 answers
  1. Nahid
    Nahid avatar
    31 posts
    Member since:
    Aug 2010

    Posted 29 Sep 2010 Link to this post

    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
  2. Dimo
    Admin
    Dimo avatar
    8474 posts

    Posted 29 Sep 2010 Link to this post

    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
  3. Nahid
    Nahid avatar
    31 posts
    Member since:
    Aug 2010

    Posted 30 Sep 2010 Link to this post

    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
  4. Dimo
    Admin
    Dimo avatar
    8474 posts

    Posted 30 Sep 2010 Link to this post

    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
  5. Nahid
    Nahid avatar
    31 posts
    Member since:
    Aug 2010

    Posted 12 Oct 2010 Link to this post

    Hi Dimo,
    Thanks for your replay. But how can I send you  my demo project ?

    Thanks
    Md Nasir Uddin
  6. Dimo
    Admin
    Dimo avatar
    8474 posts

    Posted 12 Oct 2010 Link to this post

    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
Back to Top