Click here to Skip to main content
15,881,803 members
Articles / Web Development / ASP.NET

Download "XAP" Packages on Demand in Silverlight

Rate me:
Please Sign up or sign in to vote.
4.60/5 (5 votes)
8 Oct 2010CPOL8 min read 51K   1.4K   26  
This article introduces a method to download and use "XAP" packages on demand in Silverlight.
<%@ Page Language="C#" AutoEventWireup="true"
    EnableSessionState="False" EnableViewState="false"
    CodeBehind="Default.aspx.cs" Inherits="XapWebHost.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Silverlight Download on Demand Example</title>
    <link rel="SHORTCUT ICON" href="Images/rubik.ico" />
    <link href="Styles/SilverlightDefault.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/Silverlight.js" type="text/javascript"></script>
</head>
<body>
    <div id="silverlightControlHost">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
            width="100%" height="100%">
		  <param name="source" value="ClientBin/XapLoader.xap"/>
		  <param name="onError" value="onSilverlightError" />
		  <param name="background" value="white" />
		  <param name="minRuntimeVersion" value="4.0.50826.0" />
		  <param name="autoUpgrade" value="true" />
		  <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0"
            style="text-decoration:none">
 			  <img src="http://go.microsoft.com/fwlink/?LinkId=161376"
                alt="Get Microsoft Silverlight" style="border-style:none"/>
		  </a>
	    </object><iframe id="_sl_historyFrame"
            style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
I have been working in the IT industry for some time. It is still exciting and I am still learning. I am a happy and honest person, and I want to be your friend.

Comments and Discussions