Request.Browser.MajorVersion returns wrong version

S

Sandy

I am stumped.

I use IE 6. I have a User Control that I use. One part of the User
control checks the browser type and version for compatibility control.
I use this line for the version:



Request.Browser.MajorVersion


I go to a page with the control in it,it shows the version as 4.

Are there attributes of the page/control which I may have
inadvertently set which could cause this? If so can you tell me how to
find them? I use Visual Studio 2003 if that helps.

Thanks.
 
C

Craig Deelsnyder

I use IE 6. I have a User Control that I use. One part of the User
control checks the browser type and version for compatibility control.
I use this line for the version:

Request.Browser.MajorVersion

I go to a page with the control in it,it shows the version as 4.

The major version I believe is read off of the Mozilla portion of the
user-agent string. An example of a user-agent string for IE 6.0 is

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

You have to parse the rest of the agent string to tell exactly what
version of that type of browser. So you could search for MSIE 6.0 or just
MSIE 6.
 

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

Top