Retrieve browser details using C#.Net


In this article, we will discuss how to get browser details like browser name, browser version etc using C#.Net. You can also check my previous posts on:
C#.Net provides HttpBrowserCapabilities class to interact with browser properties. This class present in System.Web namespace. So before using the HttpBrowserCapabilities we need to import the namespace.
Full code:
lblBrowserDetails.Text = “Browser name: ” + Request.Browser.Browser
            + ” Browser Type: ” + Request.Browser.Type
            + ” Browser Version :” + Request.Browser.Version
            + ” Browser Major Version: ” + Request.Browser.MajorVersion
            + ” Browser Minor Version: ” + Request.Browser.MinorVersion
            + ” Is Browser in Beta version? ” + Request.Browser.Beta;
The output will be like below:
IE:
Browser name: IE Browser Type: IE8 Browser Version: 8.0 Browser Major Version: 8 Browser Minor Version: 0 Is Browser in Beta version? False
Firefox:
Browser name: Firefox Browser Type: Firefox15 Browser Version: 15.0 Browser Major Version: 15 Browser Minor Version: 0 Is Browser in Beta version? False
Chrome:
Browser name: Chrome Browser Type: Chrome21 Browser Version: 21.0 Browser Major Version: 21 Browser Minor Version: 0 Is Browser in Beta version? False
Check out Best Alternative to InfoPath -> Try Now

You May Also like the Following SharePoint Online Tutorials:

About Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

View all posts by Bijay Kumar →