How to get browser name ?

Posted on 2007-12-03
Last Modified: 2012-06-27

Is it a possible to know which browser is used by user from asp net using vb2005?

I need to know since I need to set some properties to make aspx form work at  both browser.

Please help.

Thank you.
Question by:emi_sastra
LVL 16

Accepted Solution

Edwin_C earned 500 total points
ID: 20400798
You can use the Request object.  Below is the sample from MSDN doc

Dim bc As HttpBrowserCapabilities = Request.Browser
Response.Write("<p>Browser Capabilities:</p>")
Response.Write("Type = " & bc.Type & "<br>")
Response.Write("Name = " & bc.Browser & "<br>")
Response.Write("Version = " & bc.Version & "<br>")
Response.Write("Major Version = " & bc.MajorVersion & "<br>")
Response.Write("Minor Version = " & bc.MinorVersion & "<br>")
Response.Write("Platform = " & bc.Platform & "<br>")
Response.Write("Is Beta = " & bc.Beta & "<br>")
Response.Write("Is Crawler = " & bc.Crawler & "<br>")
Response.Write("Is AOL = " & bc.AOL & "<br>")
Response.Write("Is Win16 = " & bc.Win16 & "<br>")
Response.Write("Is Win32 = " & bc.Win32 & "<br>")
Response.Write("Supports Frames = " & bc.Frames & "<br>")
Response.Write("Supports Tables = " & bc.Tables & "<br>")
Response.Write("Supports Cookies = " & bc.Cookies & "<br>")
Response.Write("Supports VB Script = " & bc.VBScript & "<br>")
Response.Write("Supports JavaScript = " & bc.JavaScript & "<br>")
Response.Write("Supports Java Applets = " & bc.JavaApplets & "<br>")
Response.Write("Supports ActiveX Controls = " & bc.ActiveXControls & "<br>")
Response.Write("CDF = " & bc.CDF & "<br>")

LVL 22

Expert Comment

ID: 20400802
Hi there,
Take a look at this, this is a pretty comprehensive answer to your question


Author Comment

ID: 20400829
Thank you very much.

Expert Comment

ID: 20400836
Request.Browser.Type to fetch the Browser name/type as follows
If (Request.Browser.Type.ToString().Contains("IE6")) Then

            'do something

ElseIf (Request.Browser.Type.ToString().Contains("Firefox")) Then

            'do somthing else

End If

Open in new window


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: (…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now