如何在ASP.NET中使用Silverlight?

时间:2020-12-17 15:15:04

How do I use a XAP file created in Silverlight in my ASP.NET application?? I mean what are all the registration and changes to be done in the pages in order for the Silverlight content to be displayed in my aspx page?

如何在ASP.NET应用程序中使用在Silverlight中创建的XAP文件?我的意思是,为了让Silverlight内容显示在我的aspx页面中,所有要在页面中完成的注册和更改是什么?

3 个解决方案

#1


Use the Silverlight ASP.NET control on your page and reference your .xap which should be in your ClientBin folder.

在页面上使用Silverlight ASP.NET控件并引用应位于ClientBin文件夹中的.xap。

<asp:Silverlight ID="Silverlight1" runat="server" 
Source="../ClientBin/Something.xap" MinimumVersion="2.0" 
Width="100%" Height="100%" />

#2


you will need an aspx page that references your XAP file

您将需要一个引用您的XAP文件的aspx页面

#3


If you create a new Silverlight application in Visual Studio, one of the options while creating the project is to have Visual Studio create an ASP.NET project that displays your Silverlight app. You could probably start with that code, and then integrate it into your application.

如果在Visual Studio中创建新的Silverlight应用程序,则在创建项目时,其中一个选项是让Visual Studio创建一个显示Silverlight应用程序的ASP.NET项目。您可以从该代码开始,然后将其集成到您的应用程序中。

#1


Use the Silverlight ASP.NET control on your page and reference your .xap which should be in your ClientBin folder.

在页面上使用Silverlight ASP.NET控件并引用应位于ClientBin文件夹中的.xap。

<asp:Silverlight ID="Silverlight1" runat="server" 
Source="../ClientBin/Something.xap" MinimumVersion="2.0" 
Width="100%" Height="100%" />

#2


you will need an aspx page that references your XAP file

您将需要一个引用您的XAP文件的aspx页面

#3


If you create a new Silverlight application in Visual Studio, one of the options while creating the project is to have Visual Studio create an ASP.NET project that displays your Silverlight app. You could probably start with that code, and then integrate it into your application.

如果在Visual Studio中创建新的Silverlight应用程序,则在创建项目时,其中一个选项是让Visual Studio创建一个显示Silverlight应用程序的ASP.NET项目。您可以从该代码开始,然后将其集成到您的应用程序中。