Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 2.0
System.Web
HttpRequest Class
 Browser Property
Collapse All/Expand All Collapse All
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
.NET Framework Class Library
HttpRequest.Browser Property

Gets or sets information about the requesting client's browser capabilities.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

Visual Basic (Declaration)
Public Property Browser As HttpBrowserCapabilities
Visual Basic (Usage)
Dim instance As HttpRequest
Dim value As HttpBrowserCapabilities

value = instance.Browser

instance.Browser = value
C#
public HttpBrowserCapabilities Browser { get; set; }
C++
public:
property HttpBrowserCapabilities^ Browser {
    HttpBrowserCapabilities^ get ();
    void set (HttpBrowserCapabilities^ value);
}
J#
/** @property */
public HttpBrowserCapabilities get_Browser ()

/** @property */
public void set_Browser (HttpBrowserCapabilities value)
JScript
public function get Browser () : HttpBrowserCapabilities

public function set Browser (value : HttpBrowserCapabilities)

Property Value

An HttpBrowserCapabilities object listing the capabilities of the client's browser.

The following code example sends a list of the browser's capabilities back to the client in an HTML page.

Visual Basic
Dim bc As HttpBrowserCapabilities = Request.Browser
Response.Write("<p>Browser Capabilities:</p>")
Response.Write("Type = " & bc.Type & "<br>")
Response.Write("Name = " & bc.Browser & "<br>")
Response.Write("Version = " & bc.Version & "<br>")
Response.Write("Major Version = " & bc.MajorVersion & "<br>")
Response.Write("Minor Version = " & bc.MinorVersion & "<br>")
Response.Write("Platform = " & bc.Platform & "<br>")
Response.Write("Is Beta = " & bc.Beta & "<br>")
Response.Write("Is Crawler = " & bc.Crawler & "<br>")
Response.Write("Is AOL = " & bc.AOL & "<br>")
Response.Write("Is Win16 = " & bc.Win16 & "<br>")
Response.Write("Is Win32 = " & bc.Win32 & "<br>")
Response.Write("Supports Frames = " & bc.Frames & "<br>")
Response.Write("Supports Tables = " & bc.Tables & "<br>")
Response.Write("Supports Cookies = " & bc.Cookies & "<br>")
Response.Write("Supports VB Script = " & bc.VBScript & "<br>")
Response.Write("Supports JavaScript = " & bc.JavaScript & "<br>")
Response.Write("Supports Java Applets = " & bc.JavaApplets & "<br>")
Response.Write("Supports ActiveX Controls = " & bc.ActiveXControls & "<br>")
Response.Write("CDF = " & bc.CDF & "<br>")
   
C#
HttpBrowserCapabilities bc = Request.Browser;
Response.Write("<p>Browser Capabilities:</p>");
Response.Write("Type = " + bc.Type + "<br>");
Response.Write("Name = " + bc.Browser + "<br>");
Response.Write("Version = " + bc.Version + "<br>");
Response.Write("Major Version = " + bc.MajorVersion + "<br>");
Response.Write("Minor Version = " + bc.MinorVersion + "<br>");
Response.Write("Platform = " + bc.Platform + "<br>");
Response.Write("Is Beta = " + bc.Beta + "<br>");
Response.Write("Is Crawler = " + bc.Crawler + "<br>");
Response.Write("Is AOL = " + bc.AOL + "<br>");
Response.Write("Is Win16 = " + bc.Win16 + "<br>");
Response.Write("Is Win32 = " + bc.Win32 + "<br>");
Response.Write("Supports Frames = " + bc.Frames + "<br>");
Response.Write("Supports Tables = " + bc.Tables + "<br>");
Response.Write("Supports Cookies = " + bc.Cookies + "<br>");
Response.Write("Supports VB Script = " + bc.VBScript + "<br>");
Response.Write("Supports JavaScript = " + bc.JavaScript + "<br>");
Response.Write("Supports Java Applets = " + bc.JavaApplets + "<br>");
Response.Write("Supports ActiveX Controls = " + bc.ActiveXControls + "<br>");
Response.Write("CDF = " + bc.CDF + "<br>");
    
J#
HttpBrowserCapabilities bc = get_Request().get_Browser();

get_Response().Write("<p>Browser Capabilities:</p>");
get_Response().Write(("Type = " + bc.get_Type() + "<br>"));
get_Response().Write(("Name = " + bc.get_Browser() + "<br>"));
get_Response().Write(("Version = " + bc.get_Version() + "<br>"));
get_Response().Write(("Major Version = " + bc.get_MajorVersion()
    + "<br>"));
get_Response().Write(("Minor Version = " + bc.get_MinorVersion()
    + "<br>"));
get_Response().Write(("Platform = " + bc.get_Platform() + "<br>"));
get_Response().Write(("Is Beta = " + bc.get_Beta() + "<br>"));
get_Response().Write(("Is Crawler = " + bc.get_Crawler() + "<br>"));
get_Response().Write(("Is AOL = " + bc.get_AOL() + "<br>"));
get_Response().Write(("Is Win16 = " + bc.get_Win16() + "<br>"));
get_Response().Write(("Is Win32 = " + bc.get_Win32() + "<br>"));
get_Response().Write(("Supports Frames = " + bc.get_Frames() + "<br>"));
get_Response().Write(("Supports Tables = " + bc.get_Tables() + "<br>"));
get_Response().Write(("Supports Cookies = " + bc.get_Cookies()
    + "<br>"));
get_Response().Write(("Supports VB Script = " + bc.get_VBScript()
    + "<br>"));
get_Response().Write(("Supports JavaScript = " + bc.get_JavaScript()
    + "<br>"));
get_Response().Write(("Supports Java Applets = "
    + bc.get_JavaApplets() + "<br>"));
get_Response().Write(("Supports ActiveX Controls = "
    + bc.get_ActiveXControls() + "<br>"));
get_Response().Write(("CDF = " + bc.get_CDF() + "<br>"));
JScript
var bc : HttpBrowserCapabilities = Request.Browser
Response.Write("<p>Browser Capabilities:</p>")
Response.Write("Type = " + bc.Type + "<br>")
Response.Write("Name = " + bc.Browser + "<br>")
Response.Write("Version = " + bc.Version + "<br>")
Response.Write("Major Version = " + bc.MajorVersion + "<br>")
Response.Write("Minor Version = " + bc.MinorVersion + "<br>")
Response.Write("Platform = " + bc.Platform + "<br>")
Response.Write("Is Beta = " + bc.Beta + "<br>")
Response.Write("Is Crawler = " + bc.Crawler + "<br>")
Response.Write("Is AOL = " + bc.AOL + "<br>")
Response.Write("Is Win16 = " + bc.Win16 + "<br>")
Response.Write("Is Win32 = " + bc.Win32 + "<br>")
Response.Write("Supports Frames = " + bc.Frames + "<br>")
Response.Write("Supports Tables = " + bc.Tables + "<br>")
Response.Write("Supports Cookies = " + bc.Cookies + "<br>")
Response.Write("Supports VB Script = " + bc.VBScript + "<br>")
Response.Write("Supports JavaScript = " + bc.JavaScript + "<br>")
Response.Write("Supports Java Applets = " + bc.JavaApplets + "<br>")
Response.Write("Supports ActiveX Controls = " + bc.ActiveXControls + "<br>")
Response.Write("CDF = " + bc.CDF + "<br>")

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker