Home ASP.NET Hosting Dedicated Servers Contact Us
Announcements
Virtual Tiers
.NET Applications
XML Web Services
SQL Server Database
Web Traffic Statistics
Much More...
ASP.NET Web Site Hosting
Dedicated Servers
Windows 2003 Server
2.4 GHz Pentium 4
1024 MB RAM
80 GB Hard Drive
1000 GB/month
Fully Managed
Free Setup!
$268.00/month
Windows Dedicated Servers
Specialized Plans
10 or more Domains
Windows Services
Custom Plans
Windows Services
Learning & Support
About Us
ASP.NET Tutorial Web Sites
123aspx.com
411asp.net
dotnetfreaks.com
wwwcoder.com



ASP.NET Tutorial Detect Browser Capabilities



Learn More about Server Intellect



More ASP.NET Tutorials

Detecting Browser Capabilities using ASP.NET is pretty easy. Below you will find a few ASP.NET examples and ASP.NET samples that take advantage of the HttpRequest.Browser Class.

ActiveXControls False
Code Request.Browser.ActiveXControls

Gets a value indicating whether the client browser supports ActiveX controls.

If Request.Browser.ActiveXControls = True Then
Response.Write("This browser supports Active X Controls")
End If


AOL False
Code Request.Browser.AOL
Gets a value indicating whether the client is an America Online (AOL) browser.

If Request.Browser.AOL = True Then
Response.Write("This browser is an AOL Browser")
End If

BackSounds False
Code Request.Browser.BackgroundSounds
Gets a value indicating whether the client browser supports background sounds.

If Request.Browser.BackgroundSounds = True Then
Response.Write("This browser supports Background Sounds")
End If

Beta False
Code Request.Browser.Beta
Gets a value indicating whether the browser is a beta release.

If Request.Browser.Beta = True Then
Response.Write("This browser is a Beta release")
End If

Browser Unknown
Code Request.Browser.Browser
Gets the browser string (if any) that was transmitted in the User-Agent header.

Response.Write(Request.Browser.Beta)

CDF False
Code Request.Browser.CDF
Gets a value indicating whether the client browser supports Channel Definition Format (CDF) for webcasting.

If Request.Browser.CDF = True Then
Response.Write("This browser supports CDF")
End If

CLR 0.0
Code Request.Browser.ClrVersion.ToString
Gets the version number of the .NET common language runtime installed on the client.

If Request.Browser.ClrVersion.ToString <> "0.0" Then
Response.Write("This client supports the .NET Framework!")
End If

Cookies True
Code Request.Browser.Cookies
Gets a value indicating whether the client browser supports cookies.

If Request.Browser.Cookies = True Then
Response.Write("This browser supports Cookies")
End If

Crawler False
Code Request.Browser.Crawler
Gets a value indicating whether the client browser is a Web crawler search engine.

If Request.Browser.Crawler = True Then
Response.Write("This agent is a Crawler")
End If

EcmaScriptVersion 0.0
Code Request.Browser.EcmaScriptVersion.ToString
Gets the version number of ECMA script that the client browser supports.

Response.Write(Request.Browser.EcmaScriptVersion.ToString)

Frames False
Code Request.Browser.Frames
Gets a value indicating whether the client browser supports HTML frames.

If Request.Browser.Frames = True Then
Response.Write("This browser supports Frames")
End If

JavaApplets False
Code Request.Browser.JavaApplets
Gets a value indicating whether the client browser supports Java applets.

If Request.Browser.JavaApplets = True Then
Response.Write("This browser supports JavaApplets")
End If

JavaScript False
Code Request.Browser.JavaScript
Gets a value indicating whether the client browser supports JavaScript.

If Request.Browser.JavaScript = True Then
Response.Write("This browser supports JavaScript")
End If

MajorVersion 0
Code Request.Browser.MajorVersion
Gets the major (that is, integer) version number of the client browser.

Response.Write(Request.Browser.MajorVersion)

MinorVersion 0
Code Request.Browser.MinorVersion
Gets the minor (that is, decimal) version number of the client browser.

Response.Write(Request.Browser.MinorVersion)

MSDomVersion 0.0
Code Request.Browser.MSDomVersion.ToString
Gets the version of Microsoft HTML (MSHTML) Document Object Model (DOM) that the client browser supports.

Response.Write(Request.Browser.MSDomVersion.ToString)

Platform Unknown
Code Request.Browser.Platform
Gets the name of the platform that the client uses.

Response.Write(Request.Browser.Platform)

Tables False
Code Request.Browser.Tables
Gets a value indicating whether the client browser supports HTML tables.

If Request.Browser.Tables = True Then
Response.Write("This browser supports Tables")
End If

Type Unknown
Code Request.Browser.Type
Gets the name and major (that is, integer) version number of the client browser.

Response.Write(Request.Browser.Type)

VBScript False
Code Request.Browser.VBScript
Gets a value indicating whether the client browser supports VBScript.

If Request.Browser.VBScript = True Then
Response.Write("This browser supports VBScript")
End If

W3CDomVersion 0
Code Request.Browser.W3CDomVersion
Gets the version of the World Wide Web Consortium (W3C) XML Document Object Model (DOM) that the client browser supports.

Response.Write(Request.Browser.W3CDomVersion)

Version 0.0
Code Request.Browser.Version
Gets the full (integer and decimal) version number of the client browser.

Response.Write(Request.Browser.Version)

Win16 False
Code Request.Browser.Win16
Gets a value indicating whether the client is a Win16-based computer.

If Request.Browser.Win16 = True Then
Response.Write("This client is Win16")
End If

Win32 False
Code Request.Browser.Win32
Gets a value indicating whether the client is a Win32-based computer.

If Request.Browser.Win32 = True Then
Response.Write("This client is Win32")
End If

Do you have an ASP.NET Tutorial you would like to see here? Contact Us!