Export (0) Print
Expand All

HttpRequest.Browser Property

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

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

public HttpBrowserCapabilities Browser { get; set; }
/** @property */
public HttpBrowserCapabilities get_Browser ()

/** @property */
public void set_Browser (HttpBrowserCapabilities value)

public function get Browser () : HttpBrowserCapabilities

public function set Browser (value : HttpBrowserCapabilities)

Not applicable.

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.

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>");
    

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>"));

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 Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft