Skip to main content
Home Forums Silverlight Programming Programming with .NET - General A strange rendering issue
4 replies. Latest Post by RhondaBailey on June 9, 2009.
(0)
RhondaBa...
Member
7 points
42 Posts
06-09-2009 2:43 PM |
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?
<%@ 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
Participant
1542 points
216 Posts
06-09-2009 3:49 PM |
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.
06-09-2009 4:04 PM |
That seems to be the issue. Thanks a ton.
Rhonda
06-09-2009 6:16 PM |
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.
06-09-2009 6:24 PM |
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.