473,714 Members | 2,623 Online
Bytes | Software Development & Data Engineering Community
+ 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.Browse r.Browser.ToUpp er().IndexOf("I E") >= 0 And
Request.Browser .MajorVersion >= 5 And Request.Browser .ActiveXControl s =
True) Then

Thanks.

Nov 18 '05 #1
2 5184
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******** ********@TK2MSF TNGP10.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.Browse r.Browser.ToUpp er().IndexOf("I E") >= 0 And
Request.Browser .MajorVersion >= 5 And Request.Browser .ActiveXControl s =
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******** ******@TK2MSFTN GP10.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.Browse r.Browser.ToUpp er().IndexOf("I E") >= 0 And
Request.Browser .MajorVersion >= 5 And Request.Browser .ActiveXControl s =
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
2383
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 - not with the built in gizmo). The session times out after 30 minutes. The problem : User may take longer than 30 minutes to fill out the form. They would need to log back in on submission - but if I redirect then they loose
5
1116
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 Premium Usenet Newsgroup Services ---------------------------------------------------------- ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY ** ---------------------------------------------------------- http://www.usenet.com
3
1440
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 and version when i request the page from Internet Explorer 6.0. But when i request the page from Netscape 7.1 it shows me the version as 5.0 and major version as 5 and minor version as 0. Is it a bug? Please clarify.
4
1430
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 time. In IE, my code is doing what it is supposed to do i.e.., it is not executing that piece of code whenever page is posted back but in firefox browser it is executing even if it is a postback.
1
2211
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 Inherits System.Web.UI.Page
4
2722
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 'target browser'? I'm having a helluva time with table layouts etc and goin' stir crazy.. Thanks, Paul.
0
978
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 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...
10
14156
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: " & Request.Form("NewsTitle") & "<br />" End If %>
0
1075
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 assuming that this problem is that this agent string is not being recognized. I would have thought that this would result in some type of unknown browser browser object being created rather that had some type of value for all properties but surely...
0
8801
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9015
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6634
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5947
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4464
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4725
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2520
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2110
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.