views:

527

answers:

3

I downloaded and installed the Silverlight 3 Tools.

I want to use the Silverlight server control in an ASP.net page, but I don't have the Silverlight tab in my toolbox.

I also can't find System.Web.Silverlight.dll to add it myself.

+4  A: 

That will be because in silverlight 3 that control has been removed. You need to build the <object ... tag yourself. Here is a simple example:-

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">  
  <param name="source" value="ClientBin/SilverlightApplication1.xap"/>
  <param name="background" value="white" />
  <param name="minRuntimeVersion" value="3.0.40624.0" />
  <param name="autoUpgrade" value="true" />
  <a href="http://go.microsoft.com/fwlink/?LinkID=149156&amp;v=3.0.40624.0" style="text-decoration:none">
     <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style:none"/>
  </a>
</object>

However if you want the standard error handling and automatic reload when SL installed behaviour you will need to add the onError parameter to point at function to handle the errors and include the silverlight.js which is still part of the SL3 install.

AnthonyWJones
So what ARE the tools? Shouldn't there still be a silverlight tab in my toolbaox?
Ronnie Overby
The tools comprise primarly of developer runtime version of Silverlight and the SDK. In an ASP.NET site or application you won't see anything from SL in your toolbox since there isn't any relevant. The Tools do add new project templates for Silverlight projects. Its when you are developing a SL project that you will see a bunch of items (similar to the WPF controls) in your toolbox.
AnthonyWJones
This is one where MS really gets on my nerve. I love what they do, but this one irritates. How can you remove a server control that was used in production environments?! Now its hard to upgrade. Whats the reason to remove this control? It did nothing but make things easier.
irperez
+3  A: 

No, there aren't any Silverlight controls in Silverlight 3. You can still use asp:Silverlight with Silverlight 3, but it's no longer part of the tools. See Pete Brown's post:

The ASP.NET Silverlight control is still available as part of the Silverlight 2 SDK, and on the MSDN Code Gallery ( http://go.microsoft.com/fwlink/?LinkId=156721 ) but is not longer being maintained as part of the Silverlight 3 tools. The Object Tag and Silverlight.js approaches provide more flexibility. When porting your Silverlight 2 projects to Silverlight 3, you may continue to use the asp.net Silverlight control, as long as you update the minimum version number and add the required iframe if using navigation, but it is recommended that you port to one of the other two approaches.

This upgrade checklist from Silverlight 2 to 3 may help.

Jon Galloway
A: 

I've got a post up about how to convert from the ASP.NET Silverlight control to the object tag if you decide to go that route with any existing projects. Hope it helps.

scottmarlowe