Skip to main content

Microsoft Silverlight

Answered Question <asp:Silverlight> transparentRSS Feed

(0)

pefc
pefc

Member

Member

100 points

49 Posts

<asp:Silverlight> transparent

How do I get the asp:Silverlight control transparent? If it´s created with the createSilverlight() function in a regular.html file, I can get it to work, but not in a .aspx page with asp:Silverlight. Here´s my code:

<asp:Silverlight runat="server" Width="710" Height="198" Source="~/Page.xaml" Windowless="True" BackColor="Transparent"/>

 

swildermuth
swildermuth

Star

Star

8320 points

1,546 Posts

Re: &lt;asp:Silverlight&gt; transparent

You sure the main canvas in your Page.xaml is transparent?

(If this has answered your question, "Mark as Answer")

Shawn Wildermuth
C# MVP, MCSD, Speaker and Author

Silverlight 3 Workshop
Miami, FL: Oct 12-14th
Portlant, OR: Dec 2-4th
Atlanta, GA: Dec 7-9th
http://silverlight-tour.com

pefc
pefc

Member

Member

100 points

49 Posts

Re: &lt;asp:Silverlight&gt; transparent

Yes.

<Canvas x:Name="parentCanvas"

xmlns="http://schemas.microsoft.com/client/2007"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

x:Class="SilverlightProject1.Page;assembly=ClientBin/SilverlightProject1.dll"

Width="710"

Height="198"

Background="Transparent"

>

tejasvi.hegde
tejasvi....

Member

Member

136 points

30 Posts

Answered Question

Re: <asp:Silverlight> transparent

You need to use  PluginBackColor="Transparent" property to set the background color to transparent 

<asp:Silverlight ID="Silverlight1" runat="server" Height="100px" PluginBackColor="Transparent" Source="~/Scene1.xaml" Width="100px" Windowless="True" />

As per ASP.NET 3.5 Extensions Preview,

System.Web.UI.SilverlightControls.Silverlight.PluginBackColor Property :
Gets or sets the color value to set for the Silverlight host background

Rgds,
Tejasvi Hegde
Calibre Technologies

Dont forget to click "Mark as Answer" on the post that helped you.

pefc
pefc

Member

Member

100 points

49 Posts

Re: <asp:Silverlight> transparent

Thanks, that works!

Ryan7979
Ryan7979

Member

Member

14 points

22 Posts

Re: <asp:Silverlight> transparent

great!

 the same problem at testpage.html, how do I set these  testpage.html ?

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities