locked
Silverlight control does not displays in <table> element RRS feed

  • Question

  • Hey Guys,

    Quiet annoying issue found with silverlight 2 beta 2. Putting <asp:Silverlight>  control in <table> element does not dispay silverlight control.

     

    Follwoing is the sample page generated with Install Silverlight Tools Beta 2 for Visual Studio 2008, which works fine with original generated code. that is to say without the highlited <table><tr><tdand </td></tr></table>  tags, but with these tags, when viewed page in browser does not display silverlight control.

     

    <%@ Page Language="C#" AutoEventWireup="true" %><%@ 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" style="height:100%;"><head runat="server"><title>Test Page For SilverlightApplication1</title></head><body style="height:100%;margin:0;">    <form id="form1" runat="server" style="height:100%;">        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>        <table><tr><td>        <div  style="height:100%;">            <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/SilverlightApplication1.xap" MinimumVersion="2.0.30523" Width="100%" Height="100%" />        </div>        </td></tr></table>    </form></body>

    </html>

    Any body Any help please.

    Thanks in advance.

    - Pinal Bhatt

     

     

    Thursday, July 17, 2008 3:17 PM

Answers

  • Try this.  Add a height and a width to the table containing the Silverlight control.  You may also want to add a single character of white space inside the TD containing the control.

    Thursday, July 17, 2008 3:55 PM

All replies

  • Try this.  Add a height and a width to the table containing the Silverlight control.  You may also want to add a single character of white space inside the TD containing the control.

    Thursday, July 17, 2008 3:55 PM
  • Thanks a million buddy. It seems to be working after providing height and width to the TD containing asp:silverlight control. Even without extra character of white space.

    I could not understand this behaviour. if you can explain it.

    - Pinal Bhatt

    Thursday, July 17, 2008 4:05 PM
  • Basically when the table was rendered it couldn't 'see' the size of the contents so it either didn't render at all or only rendered to the size of a single white-space character.

    Thursday, July 17, 2008 4:31 PM
  • thanks .. it works for me ...

    Wednesday, January 25, 2012 1:39 PM