- Copy Elisy.Web.dll assembly into Asp.Net Bin folder. Please ensure it has version
2.1 or higher.
- Create Asp.Net HTTP-handler (ashx-file) or download it from the post attachment.
In the attached file you can see 3 alternative ways to return Silverlight sources.
- Rewrite ProcessRequest method of the HTTP-handler in the following form:
context.Response.ContentType = "application/x-zip-compressed";
Package xap = new Package();
xap.Files.Add(new File("AppManifest.xaml", context.Server.MapPath("~/Resources/AppManifest.xaml")));
xap.Files.Add(new File("Elisy.Barcode.dll", context.Server.MapPath("~/Resources/Elisy.Barcode.dll")));
xap.Files.Add(new File("TestBarcode.dll", context.Server.MapPath("~/Resources/TestBarcode.dll")));
xap.Write(context.Response.OutputStream);
- Set Source property of the Silverlight object on html- or aspx- page to your HTTP-handler.
Or if you use Elisy Silverlight server control write it in the following form:
<els:Silverlight runat="server" Version="2.0" Width="600px" Height="600px" Source="Default.xap.ashx"/>
- Elisy.Web.Xap.File class supports 2 constructors to archive file from disk or from
byte array. In the above sample all the files are stored in the "~/Resources" folder.
Default.xap.ashx.txt (1.63 kb)
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5