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