从服务器上后面(aspx.cs)的asp.net代码如何确定客户端上是否安装了Silverlight? [英] From asp.net code behind (aspx.cs) on the server how can I determine if Silverlight is installed on the client?

查看:57
本文介绍了从服务器上后面(aspx.cs)的asp.net代码如何确定客户端上是否安装了Silverlight?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

承载ASP.NET 3.5的IIS 6.0。从服务器上运行的Visual Studio 2008 aspx代码(aspx.cs)后面,我需要确定客户端上是否安装了Silverlight,以及是否安装了哪个版本。

IIS 6.0 hosting ASP.NET 3.5. From the Visual Studio 2008 aspx code behind (aspx.cs) running on the server I need to determine if Silverlight is installed on the client and if so which version.

我从客户端上的Java知道可以做到这一点。那不是我所需要的。

I know from Java on the client this can be done. That is not what I need.

我知道我可以放入一个控件,如果安装了Silverlight,则该控件将呈现。那不是我所需要的。

I know I can put in a control that will render if Silverlight is installed. That is not what I need.

推荐答案

似乎Silverlight不会将任何信息添加到随每个请求发送给服务器的用户代理字符串中(通过浏览器)。因此,可能无法在服务器端检测到Silverlight。

It seems Silverlight does not add any information to the user-agent string that is sent to the server with every request (by the browser). So it will probably not be possible to detect Silverlight on the server-side.

这意味着,您必须在客户端(使用javascript)进行检测。 ,例如使用 silverlight.js

This means, you'll have to detect it on the client-side (using javascript), e.g. using silverlight.js.

这篇关于从服务器上后面(aspx.cs)的asp.net代码如何确定客户端上是否安装了Silverlight?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆