views:

119

answers:

3

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.

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

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

A: 

The only way to know if a client has something is on the client. The server really don't know (and don't need to) know nothing about the clients.

You could execute the Javascript on client and send the result to the server with ajax if you need to.

Limo Wan Kenobi
The server does need to know the capabilites of the client. Currently in the HTTP request there is a lot of information such as browser and version, cookies enabled, ... Unfortunately Silverlight information is not in the request. But I don't think Splash is in the request either. Thanks I may go with you AJAX suggestion.
Monte
A: 

The existence of the Silverlight plug-in and the version is not sent in the request headers to your server. It does not matter what web server technology your using.

The only way you can do it is to have some JavaScript or Silverlight on the page that posts back to your server.

Why do you feel you can't use on of these techniques?

tarn
Ideally I would like to know if Silverlight is installed in the Page_Load event. Since that information is not in the request that is not going to happen. I think I will use JavaScript turn on some controls either on or off. So yes I think I can use some of these techniques. Thank you.
Monte
+2  A: 

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.

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

M4N