Since there are a number of web browsers exists like Internet Explorer, FireFox, etc and all may differ in some capabilities like javascript is supported or not, a particular style is supported or not, etc. So while developing a web application we need to consider all these things because user can access your web application from any web browser.

In general client side functionality is used to detect the browser's capabilities and display the page accordingly. JavaScript is the very popular scripting language to implement this client side functionalities.

But .Net provides very easy way to get capabilities of browsers using server side code. The capabilities of a browser include things such as whether it supports cookies, javascript, frames, ActiveX controls, etc and browser type and version browser type and its version. Based on these capabilities you can decide whether to provide rich DHTML functionality or render page differently.

To retrieve the capabilities of the browser, HttpBrowserCapabilities class is used which is present in the System.Web namespace. The HttpBrowserCapabilities class contains many read only properties which provides the various details of the browser. To use it you don't have to create new instance of this class, simply use the Page.Request.Browser property which returns an instance of the HttpBrowserCapabilities class.

Following table lists various properties of HttpBrowserCapabilities class and their values on my machine:

Property Value
ActiveXControls True
AOL False
BackgroundSounds True
Beta False
Browser IE
CDF False
ClrVersion 3.5.21022
Cookies True
Crawler False
EcmaScriptVersion 1.2
Frames True
JavaApplets True
JavaScript True
MajorVersion 6
MinorVersion 0
MSDomVersion 6.0
Platform WinNT
Tables True
Type IE6
VBScript True
Version 6.0
W3CDomVersion 1.0
Win16 False
Win32 True