Can't set a fixed height on webpartzone

Last post 05-19-2008 12:21 PM by vinz. 5 replies.

Sort Posts:

  • Can't set a fixed height on webpartzone

    05-08-2008, 4:45 AM
    • Loading...
    • raxxa
    • Joined on 05-07-2008, 2:34 PM
    • Posts 11

    Hi,

    I know this question has been asked before ( http://forums.asp.net/p/497439/497439.aspx ) but I can't find a solution to my problem anywhere! I have a three column table with a webpartzone control in each column. Now I want to set the height of the webpartzones so that they fill the entire height of the table cell in which they are placed. The problem is that the webpartzone keeps adjusting its height according to the amount of webparts placed inside it! I want my webpartzones to always have the same height, no matter how many webparts they contain!

    I've tried setting the webpartzone height to 100%, various fixed sizes (in pixels) etc. but nothing works!

    I'm using ASP.NET 2.0 + AJAX 1.0 BETA 2 + AJAX Futures CTP NOV 2006

    Please help me...

     _______________________

    Raxxa of Sweden

    John a.k.a. "Raxxa"
  • Re: Can't set a fixed height on webpartzone

    05-08-2008, 11:11 PM
    • Loading...
    • vinz
    • Joined on 10-05-2007, 11:47 AM
    • Cebu Philippines
    • Posts 6,390

    Basically ASPNET Doctype doesn't recognized 100% Table Height and WebZones will rendered as Table in the page..  As a remedy for this you need to use this doctye below to work the 100% Height.. see below demo

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

            <table style="width:100%; height:100%">
                <tr>
                    <td style="width:100%; height:100%">
                        <asp:WebPartZone ID="WebPartZone1" runat="server" Width="100%" Height="100%">
                        </asp:WebPartZone>
                    </td>
                    <td style="width:100%; height:100%">
                        <asp:WebPartZone ID="WebPartZone2" runat="server" Width="100%" Height="100%">
                        </asp:WebPartZone>
                    </td>
                </tr>
            </table>

    You may also read this article for more info

    http://apptools.com/examples/tableheight.php 

    Hope that Helps!

    Vinz 

    Cheers,
    Vincent Maverick Durano


  • Re: Can't set a fixed height on webpartzone

    05-09-2008, 9:11 AM
    • Loading...
    • raxxa
    • Joined on 05-07-2008, 2:34 PM
    • Posts 11

    Thank you Vinz! It works...

    ...BUT...when I change the DOCTYPE to "HTML 4.01" I end up with another problem! Now I don't see all the verbs on my webparts! The only verb still visible is the "Minimize" verb. All the other verbs are there somewhere (I can see the rendered html for them in the source of my page) but they're invisible!

    Is there a way to take control over how ASP.NET renders the verbs? As it is now I don't have a clue!

     This problem (just like my original problem) only appears in IE...it looks just fine in Firefox. But I guess that's just how it is (I read the article at http://apptools.com/examples/tableheight.php)

     Aaaaaaaaargh!!

    John a.k.a. "Raxxa"
  • Re: Can't set a fixed height on webpartzone

    05-12-2008, 9:18 AM
    • Loading...
    • vinz
    • Joined on 10-05-2007, 11:47 AM
    • Cebu Philippines
    • Posts 6,390

    raxxa :

    ...BUT...when I change the DOCTYPE to "HTML 4.01" I end up with another problem! Now I don't see all the verbs on my webparts! The only verb still visible is the "Minimize" verb. All the other verbs are there somewhere (I can see the rendered html for them in the source of my page) but they're invisible!

    I don't have any problem with the VERBS when using that DOCTYPE...  

    Cheers,
    Vincent Maverick Durano


  • Re: Can't set a fixed height on webpartzone

    05-19-2008, 3:35 AM
    • Loading...
    • raxxa
    • Joined on 05-07-2008, 2:34 PM
    • Posts 11

     Thought I should show everyone exactly how my problem with the verbs looks like:

    If I change the DOCTYPE to HTML 4.01 my web part page looks like this in IE:

    Verb error in IE7

    On this this pic I've outlined all images (using IE Deeveloper Toolbar) and as you can see there are at least one verb missing in the title bar but there is some kind of image floating around about 50 pixels to the right of the one verb still visible (WTF!!!???) There's obviously something wrong with how IE renders this page when DOCTYPE is set to HTML 4.01. But as you also can see, the height of the webpart zones are now equal just like I want them to be.

    This is how it looks in Firefox:

    No verb error in FF

    Soo much better! Smile


    Is there something I can do to fix this?

    Or should I change the DOCTYPE back to
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    ...and try to fix the height of the webpart zones in some other way?

    John a.k.a. "Raxxa"
  • Re: Can't set a fixed height on webpartzone

    05-19-2008, 12:21 PM
    • Loading...
    • vinz
    • Joined on 10-05-2007, 11:47 AM
    • Cebu Philippines
    • Posts 6,390

    Thats kinda weird! Surprise  .. I am using that Doctype in my WebPart application because that doctype supports 100% table Height and I haven't encountered that before.. Anyways try to create another webform just for testing and create a WebPart there using that Doctype and set an Image to your WebPart verbs again and see what happens

    Cheers,
    Vincent Maverick Durano


Page 1 of 1 (6 items)