简体   繁体   中英

Using Silverlight to create a custom control C# ASP.NET

A few things off the bat.

  • I've never used Silverlight before.
  • I'll be using Silverlight v3.0 in VS2008 (3.5 framework)

I'm going to be using it to create a user control for an existing C# web application that doesn't use Silverlight currently and I'm not sure how to go about doing this.

Am I supposed to add a Silverlight Application to the current project? Do I make it it's own project and somehow import it later? Also, any considerations/worries I should know of in attempting something like this?

Not really sure where to get started. Any guidance would be appreciated. Thanks.

I've built a custom file uploader in Silverlight before, so I can give you some tips.

  1. Create a standalone silverlight project

  2. The project above builds a .xap file

  3. There is also a TestPage.html that is generated. It contains a reference to Silverlight.js and an <OBJECT> tag that hosts the control on a web page.

  4. You can use that to figure what HTML is required to host the Silverlight control.

  5. Create your own ASP.net project, and create a control that generates the required HTML.

  6. Include the .xap file and the silverlight.js file in your distribution of the custom control.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM