.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
 
WineIsGood said:
How will your ASPX page written in ASP.NET run at all if the .NET framework is not installed???
-Dave

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
 
riley said:
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

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
 
riggers said:
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

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
 
WineIsGood said:
How will your ASPX page written in ASP.NET run at all if the .NET framework is not installed???
-Dave

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" %>
<HTML>
<HEAD>
<title>Marbles Game</title>
</HEAD>
<BODY>
<form id="Form1" method="post" runat="server">
<OBJECT id="Marbles" height="350" width="495" classid="http:InTimeMarbles.dll#InTimeMarbles.InTimeMarbles" VIEWASTEXT>
</OBJECT>
</form>
</BODY>
</HTML>

Please check the http://vitalbytes.com/detect.aspx.
How does it work?
 
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.
 
Cinil said:
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.

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
 
Back
Top