473,320 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Request.Browser.MajorVersion returns wrong version

I have an application that checks for browser, version and active X enabled.

It uses the result for a simple if then.

The issue I have is that Request.Browser.MajorVersion is returning the
wrong value. I was not getting the result I wanted (no IE browser was
version >= 5) even when the browser was version 6. I tried from 2 machines,
both running IE 6 with all patches installed.

For some reason Request.Browser.MajorVersion returns this as Major Version
4. All other values are correct (IE: and Active X enabled).

Is there a setting somewhere in the project which could make this return the
wrong value?

(I was wondering about browser compatibility settings, where they are and if
they could do this?)

The actual line is:

If (Request.Browser.Browser.ToUpper().IndexOf("IE") >= 0 And
Request.Browser.MajorVersion >= 5 And Request.Browser.ActiveXControls =
True) Then

Thanks.

Nov 18 '05 #1
2 5141
Note sure exactly how this function works you could start by trying :
http://www.codeproject.com/aspnet/browsercaps.asp

--

"Roger Twomey" <ro******@vnet.on.ca> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have an application that checks for browser, version and active X enabled.
It uses the result for a simple if then.

The issue I have is that Request.Browser.MajorVersion is returning the
wrong value. I was not getting the result I wanted (no IE browser was
version >= 5) even when the browser was version 6. I tried from 2 machines, both running IE 6 with all patches installed.

For some reason Request.Browser.MajorVersion returns this as Major Version
4. All other values are correct (IE: and Active X enabled).

Is there a setting somewhere in the project which could make this return the wrong value?

(I was wondering about browser compatibility settings, where they are and if they could do this?)

The actual line is:

If (Request.Browser.Browser.ToUpper().IndexOf("IE") >= 0 And
Request.Browser.MajorVersion >= 5 And Request.Browser.ActiveXControls =
True) Then

Thanks.

Nov 18 '05 #2
you can not really trust these values, they are a guess based on parsing the
userAgent string passed in the request.

to find out why they are wrong in your case, write a page that displays the
userAgent string (its a request header), then look in your machine.config in
the browsercap section to see how its parsed. you can add/change entries to
make it work.
-- bruce (sqlwork.com)
"Roger Twomey" <ro******@vnet.on.ca> wrote in message
news:#t**************@TK2MSFTNGP10.phx.gbl...
I have an application that checks for browser, version and active X enabled.
It uses the result for a simple if then.

The issue I have is that Request.Browser.MajorVersion is returning the
wrong value. I was not getting the result I wanted (no IE browser was
version >= 5) even when the browser was version 6. I tried from 2 machines, both running IE 6 with all patches installed.

For some reason Request.Browser.MajorVersion returns this as Major Version
4. All other values are correct (IE: and Active X enabled).

Is there a setting somewhere in the project which could make this return the wrong value?

(I was wondering about browser compatibility settings, where they are and if they could do this?)

The actual line is:

If (Request.Browser.Browser.ToUpper().IndexOf("IE") >= 0 And
Request.Browser.MajorVersion >= 5 And Request.Browser.ActiveXControls =
True) Then

Thanks.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ross Dempster | last post by:
Hi everyone, this is quite involved but if anyone can help (or just likes a challenge!) i would very much appreciate it. Quick intro : I have forms based authentication (though i do it manually...
5
by: BBeasley | last post by:
I've written severl dot net applications for users who use IE only. Now I'm developing one for a netscape user. My text boxes and lables resize in Netscape. Any ideas? Posted Via Usenet.com...
3
by: Ganesh | last post by:
I am a .NET Professional and working in web development. I found a bug (i think so) while using Request.Browser object to identify the browser name and version. It shows me the correct browser name...
4
by: Diffident | last post by:
Hello Guys, I am posting my weird experience on firefox by a piece of code I have written. That piece of code is supposed to be executed when the page is not posted back i.e., for the very first...
1
by: ocn0248 | last post by:
The code bellow must be executed under safari web-browser. I need to know how I can get the major version of the safari web-browser. Thanks in advance vb.net code Partial Class SafariTest...
4
by: Paul W | last post by:
Hi - can someone point me to info on the issues/resolutions of supporting the safari browser? To help me understand, if I was developing pages in say FrontPage, what attributes would I set for...
0
by: Roger Twomey | last post by:
I have an application that checks for browser, version and active X enabled. It uses the result for a simple if then. The issue I have is that Request.Browser.MajorVersion is returning the...
10
by: Steve Last | last post by:
Hi all, I’m using IIS6 for our college Intranet and I’m having trouble using Request.Form. Here is my code: <% If Request.QueryString("action") = "show" Then Response.Write "title: " &...
0
by: germ | last post by:
we are running into a situation where accessing Request.Browser.MajorVersion causes a System.ArgumentNullException. when this happens the HTTP_USER_AGENT value is "Mozilla/4.x (Win95)" I am...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.