但是由于其只是针对开发人员版本
所以微软没有提供对这个版本安装正确提示信息
也就是说别人如果访问您用RC0编译网站WebSite
将得到信息要求他们安装Silverlight 2 Beta2
而不是RC0Runtime
所以我们非常有必要自定义安装信息
解决方案: 打开要加载Silverlightasp.net页面
页面代码类似如下(RC0版本号更新到了2.0.30923.0):
<%@ Page Language="C#" AutoEventWireup="true"%>
<%@ Register Assembly=".Web.Silverlight" Namespace=".Web.UI.SilverlightControls"
TagPrefix="asp"%>
<!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" style="height:100%;">
<head runat="server">
<title>ReleaseTest</title>
</head>
<body style="height:100%;margin:0;">
<form id="form1" runat="server" style="height:100%;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div style="height:100%;">
<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/ReleaseTest.xap" MinimumVersion="2.0.30923.0" Width="100%" Height="100%"/>
</div>
</form>
</body>
</html>
<asp:Silverlight .../>就是用来加载Silverlight应用有点而类似flash插件
<asp:Silverlight .../>下面有个
<PluginNotInstalledTemplate/>
用来自定义Runtime没有安装状态下提示信息
微软给默认情况如下相信大家都比较熟悉了
我们可以自定义安装代码如下:
<asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/ReleaseTest.xap" MinimumVersion="2.0.30923.0" Width="100%" Height="100%">
<PluginNotInstalledTemplate>
请卸载已经安装Silverlight所有版本的后安装<a href="http://go.microsoft.com/fwlink/?linkid=129011">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight RC0" style="border-style: none"/></a>
才能访问本网站WebSite
</PluginNotInstalledTemplate>
</asp:Silverlight>
在这里我设置了安装地址为Silverlight 2 RC0Runtime : http://go.microsoft.com/fwlink/?linkid=129011
这样你老板或者同事就不会频繁来问你为什么我已经安装了Silverlight了但是还是访问不了你网站WebSite了
我们自定义安装界面如下(没有做美化处理大家如果要使用可能还需要让美工帮忙处理下):>
最新评论