annotate SilverlightExampleApp/SilverlightExampleApp.Web/default.aspx @ 71:96e6fbd70f49

Latest version
author Steven Hollidge <stevenhollidge@hotmail.com>
date Mon, 23 Apr 2012 14:54:24 +0100
parents 502f5f365649
children
rev   line source
49
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
1 <%@ Page Language="C#" AutoEventWireup="true" %>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
2
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
4 <html xmlns="http://www.w3.org/1999/xhtml" >
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
5 <head id="Head1" runat="server">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
6 <title>Silverlight App Framework</title>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
7 <style type="text/css">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
8 html, body {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
9 height: 100%;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
10 overflow: auto;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
11 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
12 body {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
13 padding: 0;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
14 margin: 0;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
15 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
16 #silverlightControlHost {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
17 height: 100%;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
18 text-align:center;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
19 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
20 </style>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
21 <script type="text/javascript" src="Silverlight.js"></script>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
22 <script type="text/javascript" src="SplashScreen.js"></script>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
23 <script type="text/javascript">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
24 function onSilverlightError(sender, args) {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
25 var appSource = "";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
26 if (sender != null && sender != 0) {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
27 appSource = sender.getHost().Source;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
28 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
29
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
30 var errorType = args.ErrorType;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
31 var iErrorCode = args.ErrorCode;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
32
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
33 if (errorType == "ImageError" || errorType == "MediaError") {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
34 return;
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
35 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
36
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
37 var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
38
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
39 errMsg += "Code: " + iErrorCode + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
40 errMsg += "Category: " + errorType + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
41 errMsg += "Message: " + args.ErrorMessage + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
42
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
43 if (errorType == "ParserError") {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
44 errMsg += "File: " + args.xamlFile + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
45 errMsg += "Line: " + args.lineNumber + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
46 errMsg += "Position: " + args.charPosition + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
47 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
48 else if (errorType == "RuntimeError") {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
49 if (args.lineNumber != 0) {
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
50 errMsg += "Line: " + args.lineNumber + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
51 errMsg += "Position: " + args.charPosition + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
52 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
53 errMsg += "MethodName: " + args.methodName + " \n";
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
54 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
55
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
56 throw new Error(errMsg);
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
57 }
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
58 </script>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
59 </head>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
60 <body>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
61 <form id="form1" runat="server" style="height:100%">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
62 <div id="silverlightControlHost">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
63 <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
64 <param name="source" value="ClientBin/SilverlightExampleApp.xap"/>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
65 <param name="onError" value="onSilverlightError" />
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
66 <param name="background" value="white" />
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
67 <param name="minRuntimeVersion" value="4.0.60310.0" />
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
68 <param name="autoUpgrade" value="true" />
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
69 <param name="splashscreensource" value="SplashScreen.xaml" />
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
70 <param name="onSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" />
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
71 <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.60310.0" style="text-decoration:none">
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
72 <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
73 </a>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
74 </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
75 </form>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
76 </body>
502f5f365649 Initial load for Silverlight Example Application
Steven Hollidge <stevenhollidge@hotmail.com>
parents:
diff changeset
77 </html>