Skip to main content

Microsoft Silverlight

Answered Question A strange rendering issueRSS Feed

(0)

RhondaBailey
RhondaBa...

Member

Member

7 points

42 Posts

A strange rendering issue

Hi all, 

 I have a strange issue that seems to be only happening on one server when the sight is viewed with IE8.  The Silverlight app is only rendering in the top 1/4 of the screen.  I have attached the code from my host aspx file and the link to a screen shot.  I had to black out any sections of the page that could give away anything I am not supposed to reveal so please excuse all the blacked out sections.  It looks fine on my dev machine which is Vista 64 and IE8.  Anyone have any ideas? 

Error image 

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Web.aspx.cs" Inherits="WebMainWebSite.Web1" %>
<%@ Register Assembly="System.Web.Silverlight" Namespace="System.Web.UI.SilverlightControls" TagPrefix="asp" %>

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

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <script runat="server" type="text/C#">
        protected override void OnLoad(EventArgs e)
        {
            if (!IsPostBack)
                Xaml1.DataBind();
            base.OnLoad(e);
        }
       
        public string GetParameters()
        {
            string sParams = some stuff here;
           
            return sParams;
        }
    </script>
    <title>Web</title>
</head>
<body style="height:100%;margin:0;">
    <form id="form1" runat="server" style="height:100%;">
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <div  style="height:100%;">
            <asp:Silverlight ID="Xaml1" runat="server" InitParameters='<%# GetParameters() %>' Source="~/ClientBin/Web.xap" MinimumVersion="2.0.31005.0" Width="100%" Height="100%" />
        </div>
    </form>
</body>
</html>

clint1222
clint1222

Participant

Participant

1542 points

216 Posts

Answered Question

Re: A strange rendering issue

Hi Ronda,

I believe it has to do with IE 8 being more standards compliant.  As a quick check, in the browser in question Click Tools | Developer Tools and check the Document Mode.  If it's set to Internet Explorer 8 Standards and changing it to Internet Explorer 7 Standards solves the layout issue, then that's where your issue lies.

Several ways to resolve the Doctype issue depending on your requirements: place a <!Doctype> tag in your file; setup the server to serve the page up with IE 7 standards; or set the actual height in your div tag surrounding the Silverlight object. 

Here's some information:

http://msdn.microsoft.com/en-us/library/cc288325(VS.85).aspx

http://www.eggheadcafe.com/tutorials/aspnet/5eac37f9-f8a4-40bf-a26b-a7cd299b73c9/document-compatibility-in.aspx

Hope this helps.

RhondaBailey
RhondaBa...

Member

Member

7 points

42 Posts

Re: A strange rendering issue

That seems to be the issue.  Thanks a ton.

 

Rhonda

 

 

clint1222
clint1222

Participant

Participant

1542 points

216 Posts

Re: A strange rendering issue

Hi Rhonda,

I'd be interested in hearing about your final resolution for this issue.  Whether you decided to modify the markup of your page, set a DocType, or configure IIS, etc.

If you could drop a quick note on this thread, that would be great.  I have a feeling this issue is going to happen to many others.

RhondaBailey
RhondaBa...

Member

Member

7 points

42 Posts

Re: A strange rendering issue

I just went for the quickest solution which was to add the meta tag to the markup.  This app is just a prototype and is going to be completely re-done over the next 6 months and the issue was only happening on one server that we were running demos on.  When we do the final version of the app we will probably configure IIS but that wasn't really an option at the moment.

Rhonda

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities