January 2018 : Instructor-led Online Course in ASP.NET Core 2.0. Conducted by Bipin Joshi. Read more...
Registration for January 2018 batch of ASP.NET Core 2.0 instructor-led online course has already started. Conducted by Bipin Joshi. Register today ! Click here for more details.

<%@ Page %>

Detecting Browser Capabilities

Introduction

Many web applications provide client side functionality based on the capabilities of browser. ASP.NET provides an easy way to get capabilities of browsers. The capabilities of a browser include things such as whether it supports cookies, javascript and ActiveX controls and browser type and version. Based on these capabilities you can decide whether to provide rich DHTML functionality or render page differently.

Browser Capabilities

The capabilities of browser are accessible from Request.Browser property. This property returns an instance of System.Web.HttpBrowserCapabilities class. The HttpBrowserCapabilities class contains many read only properties that tell us more about browser. Following table lists various properties of HttpBrowserCapabilities class and their values on my machine:
ActiveXControlsTrue
AOLFalse
BackgroundSoundsTrue
BetaFalse
BrowserIE
CDFFalse
ClrVersion1.0.3705
CookiesTrue
CrawlerFalse
EcmaScriptVersion1.2
FramesTrue
JavaAppletsTrue
JavaScriptTrue
MajorVersion6
MinorVersion0
MSDomVersion6.0
PlatformWinNT
TablesTrue
TagWriterSystem.Web.UI.HtmlTextWriter
TypeIE6
VBScriptTrue
Version6.0
W3CDomVersion1.0
Win16False
Win32True

Sample Code

The article includes a sample code that displays above properties and their values. You can test it by creating a VS.NET web project and adding the files to it.

Bipin Joshi is a software consultant, an author and a yoga mentor having 22+ years of experience in software development. He also conducts online courses in ASP.NET MVC / Core and Design Patterns. He is a published author and has authored or co-authored books for Apress and Wrox press. Having embraced the Yoga way of life he also teaches Meditation and Mindfulness to interested individuals. To know more about him click here.

Get connected : Twitter  Facebook  Google+  LinkedIn

Posted On : 02 February 2003


Tags : ASP.NET Web Forms Administration