Request.Browser.MajorVersion returns wrong version

R

Roger Twomey

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.
 
B

bruce barker

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top