Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Weird problem. I'm trying to write a function to determine what Browser and version clients are using.

 

Using HttpBrowserCapabilities

...pseudo code

Dim bc As HttpBrowserCapabilities
bc = Request.Browser
Response.Write(bc.Browser & " " bc.Version)

Works fine on IE. Show "IE 6" or "IE 5.5"...etc.

 

Even works on Netscape 6.2. Shows "Netscape 6.2"

 

Here's the Problem. On versions of Netscape 7 or greater, it shows the version as 5.0

"Netscape 5.0"

 

I've tested it with 3 newer version.

7.2, 8.0 and 8.1 They all show "5.0"

 

Even if I try to use the .Majorversion + .Minorversion. Same thing.

 

When I pull the server vars for HTTP_USER_AGENT for each browser type, I get this.

 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 (ax)

 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)

 

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20050603 Netscape/8.0.2

 

Note: The first one returns the correct version (6.2) in my .Net app, where the second and third are returning the Mozilla version (5.0)

 

Anyone have any ideas how I can resolve this?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...