Discovering Browser Capabilities
One of ASP.NET’s strengths is that it accommodates differences in client browsers without requiring any special effort from the application developer. However, it is often desirable for a web application to discover the capabilities of the browser making a given request. For this purpose, ASP.NET makes browser information available to the web application. ASP.NET’s Request object (available through the Page object’s Request property) has a Browser property that returns an object of type HttpBrowserCapabilities. The properties of this object are:
- ActiveXControls
Indicates whether the client browser supports ActiveX controls. The type is Boolean.
- AOL
Indicates whether the client browser is an America Online browser. The type is Boolean.
- BackgroundSounds
Indicates whether the client browser supports background sounds. The type is Boolean.
- Beta
Indicates whether the client browser is a beta release. The type is Boolean.
- Browser
Indicates the browser string (e.g.,
"IE") received in the User-Agent header of the HTTP request. The type is String.- CDF
Indicates whether the browser supports Channel Definition Format for webcasting. The type is Boolean.
- ClrVersion
Indicates the version of the .NET CLR installed on the client (if any). The type is Version (defined in the System namespace).
- Cookies
Indicates whether the client browser supports cookies. The type is Boolean.
- Crawler
Indicates whether the client browser is a web crawler (an automated program used ...