How to get browser version

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

How can I acureatly get the browser type and versin number? I need to send
4X browsers to a different url.
 
use this..

HttpBrowserCapabilities bc = Request.Browser;
Response.Write("Type = " + bc.Type + "<br>");
Response.Write("Name = " + bc.Browser + "<br>");
Response.Write("Version = " + bc.Version + "<br>");

Av.

Request.Browser
 
Great thanks! Now there's one more thing I need. Is there a reference
table of the different values that could be returned? Unless I know exactly
what values could be returned, I won't be able to properly test to values to
determin what action to take. In other words, I need to know how to do a
comparison something like this:

If bc.Browser = "Netscape" then
If bc.version < 5 then
'redirect to bad old page
Else
'redirect to good new page
End if
End if

Thanks

--
(e-mail address removed)
avnrao said:
use this..

HttpBrowserCapabilities bc = Request.Browser;
Response.Write("Type = " + bc.Type + "<br>");
Response.Write("Name = " + bc.Browser + "<br>");
Response.Write("Version = " + bc.Version + "<br>");

Av.

Request.Browser
 
Hi Moondaddy,

Based on my research, I haven't found a certain reference table which
listed all the potential value of the
HttpBrowserCapablilities.Browser member.

Here are some related tech article on this I've found:

#Browser Capabilities Component in ASP.NET
http://www.stardeveloper.com/articles/display.html?article=2001082501&page=1

#HOW TO: Determine Browser Type in Server-Side Code Without the BrowserType
Object in ASP.NET
http://support.microsoft.com/default.aspx?scid=kb;EN-US;306576

# ASP.NET Browser issues
http://www.fuzzysoftware.com/default.asp?id=255&parentID=148


Also, I think you may have a look at the <browserCaps> setting reference in
MSDN which may provide some clues:

#<browserCaps> Element
http://msdn.microsoft.com/library/en-us/cpgenref/html/gngrfbrowsercapssectio
n.asp?frame=true

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Hi Moondaddy,

Have you had a chance to check out the suggestions in my last reply or have
you got any further ideas on this issue? If you have anything unclear or if
there're anything else we can help, please feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top