views:

919

answers:

2

I have an aspx page with 1 table containing 2 rows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

<html xmlns="http://www.w3.org/1999/xhtml"&gt;
    <head>
        <style>
        html, body 
        { 
            height: 100%; 
        } 
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                <table style="height:100%; width:100%">
                    <tr>
                        <td>                
                            <img src="img/Logo.png" />
                        </td>
                    </tr>
                    <tr>
                        <td style="height:100%;">                     
                            <asp:Silverlight 
                                ID="sllUI" 
                                runat="server" 
                                Source="~/ClientBin/My.Silverlight.UI.xap" 
                                MinimumVersion="2.0.31005.0" 
                                Width="100%" 
                                Height="100%"
                                OnPluginLoaded="sllUI_OnPluginLoaded"
                                PluginBackground="Transparent"
                                Windowless="true">        
                            </asp:Silverlight>
                        </td>
                    </tr>
                </table>                            
            </div>
        </form>
    <body>
</html>

The table fills the page correctly, and the bottom row fills grows to the remaining height of the table that the top row doesn't fill, which is what I want. The problem is that the silverlight control takes on the height of the page, not the height of the row that it is in, which causes my page to get scroll bars because the top of the silver light control is at the top of the row it's in, but it's hight is 100% of the browser. I don't know if this is caused by my html or by silverlight. All my silverlight user controls are set to auto height & width. I've also tried using divs instead of the table and I get the same result. How can I fix this?

I've found that (at least in IE7) the doctype I've specified causes it to use standards mode IE6, but if I take the doctype out it goes into quirks mode IE5 (I find the mode by using DebugBar v5.1.1). Quirks mode causes it to display properly, but I think I'd rather avoid quirks mode if I can get the display correct in standard mode.

A: 
Skubs
+1  A: 

Try removing the 'Height' and 'Width' properties in your control, if you've defined the internal XAP's height and width correctly to scale (i.e. you've used "Auto"), then it should respect what DOM boundaries it's contained within on the page.

Daniel Crenna
I'm experiencing the same kind of behaviour. I turned on the `windowless` switch, I get unecessary scrollbars.The control gets displayed properly and there some extra white space at the bottom (that can be seen using the scroolbars).Is there a way of getting rid of them? I tried playing with the height in the HTML DOM but that didn't do anything :(
R4cOON