By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,403 Members | 879 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,403 IT Pros & Developers. It's quick & easy.

Request.Browser.MajorVersion returns wrong version

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.