views:

93

answers:

2

While using

<asp:Silverlight ID="Xaml1" runat="server"/>

an error occurs. What can we do?

+1  A: 

<asp:Silverlight> does not work in silverlight 3. You should use <object>

Stephen lacy
+7  A: 

That control no longer exists in ASP.NET (see Silverlight 3 release notes). You now include the object tag in the page. If you don't know the syntax, you can just create a new Silverlight project and just copy it from the template.

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/MySilverlightApplication.xap"/>      
<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>

Specify the xap file in the source attribute.

David

related questions