Height of Tabpanel will not adjust according to content (iFrame).

Last post 12-31-2007 4:03 PM by datherton. 2 replies.

Sort Posts:

  • Height of Tabpanel will not adjust according to content (iFrame).

    01-31-2007, 3:47 PM
    • Member
      point Member
    • lawsop
    • Member since 01-23-2007, 4:30 PM
    • Minneapolis, MN
    • Posts 2

    I'm trying to use TabPanels inside of a TabContainer.  Each of the TabPanels contains an iFrame with src specified.  The problem I'm having...The panels will not adjust in size according to the content and content is not being displayed.  If I don't use frames and simply place all markup/content within the <ContentTemplate> tags, the panels' size adjusts to accomodate.  Is there a trick to getting the TabPanels to work with iFrame?

     

     

    <cc1:TabContainer runat="server" ID="Tabs" OnClientActiveTabChanged="ActiveTabChanged">

     

     

    <cc1:TabPanel runat="Server" ID="Panel1" HeaderText=" Page1 ">

    <ContentTemplate>

    <iframe src ="WebForm1.aspx"width="100%" height="100%" scrolling="no" frameborder="0"></iframe>

    </ContentTemplate>

    </cc1:TabPanel>

     

     

    <cc1:TabPanel runat="Server" ID="Panel2" HeaderText=" Page2 " >

    <ContentTemplate>

    <iframe src ="WebForm2.aspx" width="100%" height="100%" scrolling="no" frameborder="0"></iframe>

    </ContentTemplate>

    </cc1:TabPanel>

     

     

    <cc1:TabPanel runat="Server" ID="Panel3" HeaderText=" Page3 " >

    <ContentTemplate>

    <iframe src ="WebForm3.aspx" width="100%" height="100%" scrolling="no" frameborder="0"></iframe>

    </ContentTemplate>

    </cc1:TabPanel>

     

    </cc1:TabContainer>
    Lawsop
  • Re: Height of Tabpanel will not adjust according to content (iFrame).

    02-27-2007, 6:14 AM
    • Member
      83 point Member
    • suicidesquad
    • Member since 11-24-2005, 8:31 AM
    • Netherlands
    • Posts 58

    Hi, We had the same problem. We solved it with javascript. We have added the the iframe dynamically to a div that is placed in the tabpanel. You need to focus on the style='height: + screen.height + ";

    <script type="text/javascript">

    document.getElementById(

    "div" + TabElement ).innerHTML =  "<iframe src='http://" + location.hostname + "/testpage/Default.aspx' height='100%' width='100%' frameborder='0' border='0' style='height:" + screen.height + ";width:100%'></iframe>";

    </script>

     Good Luck

    Harold

  • Re: Height of Tabpanel will not adjust according to content (iFrame).

    12-31-2007, 4:03 PM
    • Member
      16 point Member
    • datherton
    • Member since 01-29-2007, 3:20 PM
    • Toronto, Canada
    • Posts 10

    This was my solution...

    http://forums.asp.net/t/1199624.aspx

    Dave

Page 1 of 1 (3 items)