473,473 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 5156
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.