Adding a Silverlight User Control into a ASP.NET page

written by Al on Thursday, March 20 2008

Got this question many times by email, instead of answering to each person, let me post it here, as well make sure to check the Silverlight forums for all you other Silverlight questions.

On the project, right click and click at the Link to Silverlight library, then do this manually

Add the binary on the web.config:

<add tagPrefix="asp" namespace="System.Web.UI.SilverlightControls"
assembly="System.Web.Silverlight" />

Register the tag:

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

Register the control

<div  style="height:100%;">
           <asp:Silverlight ID="Xaml1" runat="server"
Source="~/ClientBin/SilverlightApplication1.xap" Version="2.0"
Width="100%" Height="100%" />
       </div>

Let me know if that works for you.

Cheers

Al

 

Similar Posts

  1. Javascript communication to Silverlight 2.0
  2. Setting up Atlas to existing Web Projects without using the template ( Visual Studio 2005 )
  3. New ASP.NET AJAX

Comments

  • Mark Wisecarver on on 3.21.2008 at 8:10 AM

    Mark Wisecarver avatar

    Thanks Al, that's the way I prefer to handle it.

  • Alex on on 4.02.2008 at 9:30 AM

    Alex avatar

    Hi Al,

    I got a problem. I have no idea how to done this work "On the project, right click and click at the Link to Silverlight library"

Comments are closed

Options:

Size

Colors