.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> ASP.NET >> Post New Resource Bookmark and Share   

 Subscribe to Articles

HttpBrowserCapabilities Class

Posted By:Pankaj Mishra       Posted Date: August 09, 2008    Points: 25    Category: ASP.NET    URL: http://www.dotnetspark.com  
 

Hi,

  In .NET HttpBrowserCapabilities Class is we should use to know about the client browser.Some time we need to know about the client browser like whether client browser supports Javascript or not or client browser suppots cookies or not etc.

HttpBrowserCapabilities browserCapabilities = Request.Browser;

bool acceptCookies = browserCapabilities.Cookies; //Return boolean value

bool javascriptEnabled = browserCapabilities.JavaScript; //Return boolean value

bool supportXMLHTTP = browserCapabilities.SupportsXmlHttp; //Return boolean value.

There are so many other property by which we can get/set the value of the client browser.

 

Properties and their Description of HTTPBrowserCapabilities Class


ActiveXControls - Return Boolean value indicating whether the browser supports ActiveX controls
AOL - Return Boolean value value indicating whether the client is an AOL browser
BackgroundSounds - Return Boolean value  value indicating whether the browser supports background sounds
Beta -  Return Boolean value  value indicating whether the browser is a beta release
Browser - Gets the browser string that was transmitted in the User-Agent header
CDF -  A value indicating whether the browser supports Channel Definition Format for web casting
Cookies - Return Boolean value  value indicating whether the browser supports cookies
Crawler -  Return Boolean value value indicating whether the browser is a web crawler search engine
EcmaScriptVersion - The version number of ECMA script that the browser supports
Frames -  Return Boolean value value indicating whether the browser supports HTML frames
Item - Allows access to individual dictionary values. Further discussion is beyond the scope of this article
JavaApplets -  Return Boolean value value indicating whether the browser supports Java applets
JavaScript -  Return Boolean value  value indicating whether the browser supports JavaScript
MajorVersion -  Return major version number of the browser  of string type
MinorVersion -  Return minor version number of the browser  of string type
MSDomVersion - return version of Microsoft XML Document Object Model that the browser supports of String Type
Platform - The name of the platform that the client uses
Tables -  Return Boolean value value indicating whether the browser supports HTML tables
Type - Return name and major version number of the browser of string type
VBScript - Return Boolean value  value indicating whether the browser supports VBScript
Version - Return full major and minor version number of the browser of string type
W3CdomVersion - The version of the World Wide Web Consortium XML Document Object Model that the browser supports
Win16 - Return Boolean value value indicating whether the client is a Win 16 based machine
Win32  - Return Boolean value value indicating whether the client is a Win 32 based machine

Cheers
Pankaj

 

 

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend