托管 Silverlight xap 文件,仅显示白屏
我有一个 SL 3.0 xap,我想在 ASP.NET 网站上托管,我可以访问 XAP 文件,并且创建了一个 HTML 页面来托管 SL 组件。
当我访问该页面时,我看到的只是 SL 组件应该所在的白屏,SL 已加载但组件未显示。
有什么想法为什么会发生这种情况吗?
这是 SL div 的 HTML 代码。
<body>
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="http://lonmw32795/SliverlightRESTfulWebservice.Web/ClientBin/SliverlightRESTfulWebservice.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40818.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.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>
</form>
干杯
AWC
I have a SL 3.0 xap I want to host in a ASP.NET website, I have access to the XAP file and I have created a HTML page to host the SL component.
When I access the page all I see is a white screen where the SL component should be, SL is loaded but the component is not displayed.
Any ideas why this is happening?
This is the HTML code for the SL div.
<body>
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="http://lonmw32795/SliverlightRESTfulWebservice.Web/ClientBin/SliverlightRESTfulWebservice.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="3.0.40818.0" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40818.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>
</form>
Cheers
AWC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
请注意 JavaScript 错误,以便为您提供更多信息。
通常,错误是 IIS 未配置为正确处理 XAP 文件: 为 Silverlight 应用程序配置 IIS
Watch out for javascript errors to give you more information.
Often the error is that the IIS is not configured to handle XAP files appropriately: Configuring IIS for Silverlight Applications
当应用程序抛出 XAML 错误时,我看到了这种行为。查看 App.xaml.cs 并找到 Application_UnhandledException。
首先,只需在此方法中添加 MessageBox.Show(e.ExceptionObject.Message),而不是写入 DOM。
I have seen this behavior when the app throws a XAML error. Take a look in App.xaml.cs and find Application_UnhandledException.
To get you started just add a: MessageBox.Show(e.ExceptionObject.Message) in this method instead of writting to the DOM.
您确定没有将 Default.aspx 作为起始页并且 SL 对象位于生成的测试页之一内吗?
Are you sure that you are not having Default.aspx as your startpage and that the SL object is inside one of the generated testpages?