Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 1.53 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to load specific xaml file from a xap file?
  2. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test.Web.WebForm1" %>
  3.  
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  5. <html xmlns="http://www.w3.org/1999/xhtml">
  6. <head runat="server">
  7.     <title></title>
  8.     <script type="text/javascript" src="Silverlight.js"></script>
  9. </head>
  10. <body>
  11.     <form id="form1" runat="server">
  12.     <div id="silverlightControlHost">
  13.         <script type="text/javascript">
  14.             Silverlight.createObject(
  15.             "ClientBin/test.xap",  // source
  16.              document.getElementById('silverlightControlHost'),  // parent element
  17.             "someId",  // id for generated object element
  18.             {
  19.             width: "600px",
  20.             height: "600px",
  21.             background: "blue",
  22.             version: "4.0.60310.0",
  23.             autoUpgrade: "true"
  24.         },
  25.             { onError: null }, null
  26.         );
  27.         </script>
  28.     </div>
  29.     </form>
  30. </body>
  31. </html>
  32.        
  33. Silverlight.createObject(
  34.             "ClientBin/test.xap",  // source
  35.              document.getElementById('silverlightControlHost'),  // parent element
  36.             "someId",  // id for generated object element
  37.             {
  38.             width: "600px",
  39.             height: "600px",
  40.             background: "blue",
  41.             version: "4.0.60310.0",
  42.             autoUpgrade: "true"
  43.         },
  44.             { onError: null }, 'StartupPage=<%=Request.QueryString[File]%>'
  45.         );