IE 8 final broke SL host control height

    General discussion

  • Hi group,

    I've just installed IE8 final and it seems there is an odd behaviour in my SL apps, which work fine with IE 7. In some of these (ASP.NET) pages I used to host a SL control which must extend all the available height in the web browser window, i.e. whose height is set to 100%, like this:

    <%@ Page Title="Sample" Language="C#" MasterPageFile="~/SomeMaster.master" AutoEventWireup="true"
    CodeFile="Sample.aspx.cs" Inherits="Sample" %>

    <%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls" TagPrefix="asp" %>

    <asp:Content ID="Content1" ContentPlaceHolderID="mainCopy" Runat="Server">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div style="height:100%;">
            <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/MyApp.xap"
            MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />

    What happens when I browse to this page with IE8 is that the space reserved to the SL host control is about one third of the available browser page height, so that vertical scrollbars appear and the SL application is vertically "cut". If I set a fixed size (e.g. Height="480") it works, but I'd like to extend to the whole page height. How can I fix this?


    Tuesday, March 24, 2009 4:38 PM

All replies

  • You could force your page into IE7 mode if you do not want to set a fixed size


      <!-- Mimic Internet Explorer 7 -->
      <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
      <title>My Web Page</title>

    Tuesday, March 24, 2009 5:40 PM
  •  I've run into the same issue. setting IE7 mode works, but I am curious as to why it broke in the first place.

    Tuesday, March 24, 2009 6:48 PM
  • Microsoft spent alot of time making IE8 comply with the browser standards.  IE7 is not as compliant as IE8

    Tuesday, March 24, 2009 7:36 PM
  • I just ran into this issue too. It is really annoying! My Silverlight app takes up the entire browser window and is designed to scale to the size of the window, so I can't use a fixed height. Is there no way to do with without forcing IE7 mode?!
    Wednesday, May 13, 2009 10:01 PM
  • Hi

     I think that I face the same problem. When I run my Silverlight 2.0 application in IE7 it works just fine. After I installed IE8 the application is shown only at the third upper part of IE. I tried to set the height and width values hardcoded and it works but it is not a suitable solution since if the client has a different screen resolution the application looks bad and if the client uses IE8 in full screen mode (F11) then the application takes only upper part of the screen according to the height values that I defined. Does Microsoft has a solution for this problem???

    Tuesday, July 28, 2009 7:46 AM
  • From what I observed with this bug, the issue was with using * in the grid rows or columns. IE8 will take the * as 0 where as it should actually take it as maximum available space. So we need to avoid using Height="*" for grid rows and Width="*" for grid columns

    Sunday, December 13, 2009 2:51 AM
  • The above post is completely incorrect. This is an HTML issue, not a Silverlight issue. IE8 simply requires different HTML to persuade the Silverlight plugin to occupy the whole page height.

    Sunday, December 13, 2009 6:32 AM
  • Ok... Then what is the reason for it to occupy only 20% or 30% or 40% of the available space? why this variable height depending on the application??

    Thursday, December 17, 2009 6:31 AM
  •  Hi

    i too faced the same problem, in IE 8, there is a option called "compatible View", Click that Icon it will open your silverlight application as what you except,

    Still now i am hard-coding height and width of the silverlight, but its is not the good code

    i think there is bug in IE 8, i dont know when the microsoft will solve this issue

    if it is useful "please Mark as answer"

    Thursday, December 17, 2009 7:58 AM
  •  2 Tim Dawson:

    And what different HTML is required? Could you put a sample, please.

    The same issue occurs for other browsers, i. e. Firefox.

    Thursday, January 14, 2010 2:44 AM
  • See if this works for you...

    In your master page set the form height to 100%
    <form id="form1" runat="server" style="height: 100%">

    Similarly for the div enclosing the content placeholder
    <div style="width: 100%; height: 100%;">
    <asp:ContentPlaceHolder ID="MainPlaceholder" runat="server">

    Saturday, January 16, 2010 3:57 AM
  • I had the same issue I fixed it by adding this style tag into my silverlight object instead of just putting height="100%"


    Friday, March 16, 2012 8:22 PM
  • it works! thanks a bunch dude!

    Wednesday, June 06, 2012 8:39 PM