.NET Framework

Please help.
I would like to write a client-side validation on my ASP.NET page which can check whether the .NET Framework has been installed.
Thank you in advance,

Alexander Shifrin

How will your ASPX page written in ASP.NET run at all if the .NET framework is not installed???
-Dave

[QUOTE=WineIsGood]
How will your ASPX page written in ASP.NET run at all if the .NET framework is not installed???
-Dave
[/QUOTE]

That was my first thought too, Dave. But after rereading Ashifrin’s post, I think he just wants to see if the client has the .Net framework installed. Perhaps he is distributing .Net applications he has written and is trying to see if the target computer is capable of running them.

I’m not sure if you can get this information from a client-side script, but you can probably get the information on the server-side from the HTTP_USER_AGENT server variable. If the framework is installed on the client computer, the HTTP_USER_AGENT will look something like this:
Mozilla/4.0 (compatible; MSIE+6.0; Windows NT 5.1; .NET CLR 1.1.4322)

The “.NET CLR 1.1.4322” indicates that the 1.1.4322 common language runtime is installed. I’m not sure this is completely reliable, but you can give it a try…

riley

[QUOTE=riley]
That was my first thought too, Dave. But after rereading Ashifrin’s post, I think he just wants to see if the client has the .Net framework installed. Perhaps he is distributing .Net applications he has written and is trying to see if the target computer is capable of running them.

I’m not sure if you can get this information from a client-side script, but you can probably get the information on the server-side from the HTTP_USER_AGENT server variable. If the framework is installed on the client computer, the HTTP_USER_AGENT will look something like this:
Mozilla/4.0 (compatible; MSIE+6.0; Windows NT 5.1; .NET CLR 1.1.4322)

The “.NET CLR 1.1.4322” indicates that the 1.1.4322 common language runtime is installed. I’m not sure this is completely reliable, but you can give it a try…

riley
[/QUOTE]

I think this only works in IE.
Using firefox my weblogs show me as:
Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv:1.6)+Gecko/20040206+Firefox/0.8

[QUOTE=riggers]
I think this only works in IE.
Using firefox my weblogs show me as:
Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US;+rv:1.6)+Gecko/20040206+Firefox/0.8
[/QUOTE]

It looks like you are right.
Therefore, I amend my previous statement,
“I’m not sure this is completely reliable”,
to,
“I’m sure this is not completely reliable.”

riley

[QUOTE=WineIsGood]
How will your ASPX page written in ASP.NET run at all if the .NET framework is not installed???
-Dave
[/QUOTE]

I run my page on a server and show it on a client.
Inside of my page I create an object written in C#.
This is my code:
<%@ Page language=“c#” Codebehind=“Marbles.aspx.cs” AutoEventWireup=“false” Inherits=“WebApplication4.WebForm1” %>
<%@ Register TagPrefix=“InTime” Namespace=“InTimeMarbles” Assembly=“InTimeMarbles” %>

Marbles Game

Please check the Google .
How does it work?

this does only work in IE as said above (you are using the HTTP_USER_AGENT variable)

If you want to install a .net application on the client machine,your setup file will be already having the required files with it.It should have already packed the required .net files.

[QUOTE=Cinil]
If you want to install a .net application on the client machine,your setup file will be already having the required files with it.It should have already packed the required .net files.
[/QUOTE]

Yes, that is correct. Additionally, you can have the Setup Package check for the presence and version of the framework and download/install the correct version if necessary.

I thought perhaps that Ashifrin wanted to generate a warning for those who do not have the framework installed; that would be a much better time than after the download and during the install. Unfortunately, Ashifrin has not yet explained what it is he’s trying to accomplish…

riley