views:

196

answers:

3

Duplicate:

How do I use Silverlight from ASP.NET?

How do I add some Silverlight content to an already created ASP.NET website?

+3  A: 

Add a new Silverlight application to your existing solution. Here's an MSDN article which shows how to integrate it with your existing website, so building the Silverlight application will deploy the Silverlight control to your ASP.NET website's Client_Bin folder.

To add a Silverlight control to a webpage in your site, you can reference the Silverlight test page that's automatically created for you, or you can use the ASP:Silverlight control, which will take care of loading the Silverlight object.

Jon Galloway
A: 

You only need to copy the XAP file to your site and reference it.

When you create a blank SL project you get the boiler plate code for the ASp .net site for free.

  • Having an ASP .net 3.5 SP1 enabled site, you can asp:Silverlight control:

  • Going without any ASP .net sugar control (you can use it on ie an php page), you can use an Object intance inside a div:

Soirry tried to paste code samples but didn't work well :-(.

Braulio
A: 

Microsoft does not recommend using the ASP:Silverlight control as of Silverlight 3.

There's a great article at MSDN about how to include Silverlight using the <object> tag, or using the silverlight.js library: Integrating Silverlight with a Web Page. This helped clear up a lot of confusion for me.

This makes it much easier to provide a more customized experience that fits in better with the rest of your application.

(There's also a decent article explaining how to interact with the Silverlight control once it's embedded in your page: HTML Bridge: Interaction Between HTML and Managed Code)

Chris Jaynes