|
-
Apr 5th, 2005, 09:56 AM
#1
detect framework on the client?
is there a way via ASP.NET to detect if the client viewing the webpage has the .net framework installed?
basically i am going to be offering a program for download on the web, and i was hoping when they visit the download page, i can display one of 2 links depending on if they have the framework installed or not.
one would be the smaller install of just my app, while the other would be my app and the framework
-
Apr 5th, 2005, 03:02 PM
#2
Frenzied Member
Re: detect framework on the client?
How about something like this to get you started,....
VB Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim sBrowserString As String = Request.ServerVariables("HTTP_USER_AGENT")
If sBrowserString.IndexOf(".NET CLR 1.1") > 0 Then
Label1.Text = "The .NET Framework is installed"
End If
End Sub
~Peter

-
Apr 5th, 2005, 03:16 PM
#3
Re: detect framework on the client?
hmmm thanks MrGTI,
do you know of any other method that might work on NON IE browsers as well?
While most of the target audience will be using IE, some may have firefox/netscape, or even the AOL web browser.. I haven't testing all of these, but in firefox this is what the HTTP_USER_AGENT comes up with
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2
IE comes up with this
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 1.0.3705; .NET CLR 2.0.40607)
-
Apr 5th, 2005, 04:20 PM
#4
Re: detect framework on the client?
You should use
Code:
System.Environment.Version
Hope it helps.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Apr 5th, 2005, 04:52 PM
#5
Re: detect framework on the client?
 Originally Posted by Danial
You should use
Code:
System.Environment.Version
Hope it helps.
wont that return the version of the framework on the server running the ASP page? and not the version of the framework running on the client?
code like that runs in the code behind which means the page has not been sent to the client yet anyway
-
Apr 5th, 2005, 06:23 PM
#6
Re: detect framework on the client?
 Originally Posted by kleinma
wont that return the version of the framework on the server running the ASP page? and not the version of the framework running on the client?
code like that runs in the code behind which means the page has not been sent to the client yet anyway
Sorry, didnt read the post properly thought you need to retrive the Version of Local/Server. 
As for client machine, The BrowserCapability class comes with a property called ClrVersion e.g
Code:
Response.Write(System.Web.HttpContext.Current.Request.Browser.ClrVersion.ToString());
The thing is that it only works in IE 5.0 and Greater. It does not work in FireFox, just tested it.
Sorry couldnt be much of a help.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Apr 5th, 2005, 11:42 PM
#7
Re: detect framework on the client?
it may be that there just is not a way to detect this from the web.. I guess I can always check for the framework, and if its not IE, i will just have to give alternate options...
-
Apr 6th, 2005, 10:23 AM
#8
Frenzied Member
-
Apr 7th, 2005, 09:12 AM
#9
Re: detect framework on the client?
 Originally Posted by MrGTI
I never include the framework in my installs. (makes them too large  )
I always list the .NET Framework as a system requirement on my pages that have software downloads. That way they are required to get the most recent version from Windows Update. 
well if i was making some free app to offer for download on a site i would do that... but this is an app we are getting paid to create, and the end users are not computer savvy people, so i need to make it as painless as possible for them to get up and running
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|