Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Browser Property

HttpRequest.Browser Property

Gets information about the requesting client's browser capabilities.

[Visual Basic]
Public Property Browser As HttpBrowserCapabilities
[C#]
public HttpBrowserCapabilities Browser {get; set;}
[C++]
public: __property HttpBrowserCapabilities* get_Browser();
public: __property void set_Browser(HttpBrowserCapabilities*);
[JScript]
public function get Browser() : HttpBrowserCapabilities;
public function set Browser(HttpBrowserCapabilities);

Property Value

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

Example

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

[C++] 
HttpBrowserCapabilities* bc = Request->Browser;
 Response->Write(S"<p>Browser Capabilities:</p>");
 Response->Write(String::Format(S"Type = {0}<br>",                bc->Type));
 Response->Write(String::Format(S"Name = {0}<br>",                bc->Browser));
 Response->Write(String::Format(S"Version = {0}<br>",             bc->Version));
 Response->Write(String::Format(S"Major Version = {0}<br>", __box(bc->MajorVersion)));
 Response->Write(String::Format(S"Minor Version = {0}<br>", __box(bc->MinorVersion)));
 Response->Write(String::Format(S"Platform = {0}<br>",            bc->Platform));
 Response->Write(String::Format(S"Is Beta = {0}<br>",       __box(bc->Beta)));
 Response->Write(String::Format(S"Is Crawler = {0}<br>",    __box(bc->Crawler)));
 Response->Write(String::Format(S"Is AOL = {0}<br>",        __box(bc->AOL)));
 Response->Write(String::Format(S"Is Win16 = {0}<br>",      __box(bc->Win16)));
 Response->Write(String::Format(S"Is Win32 = {0}<br>",      __box(bc->Win32)));
 Response->Write(String::Format(S"Supports Frames = {0}<br>", __box(bc->Frames)));
 Response->Write(String::Format(S"Supports Tables = {0}<br>", __box(bc->Tables)));
 Response->Write(String::Format(S"Supports Cookies = {0}<br>", __box(bc->Cookies)));
 Response->Write(String::Format(S"Supports VB Script = {0}<br>", __box(bc->VBScript)));
 Response->Write(String::Format(S"Supports JavaScript = {0}<br>", __box(bc->JavaScript)));
 Response->Write(String::Format(S"Supports Java Applets = {0}<br>", __box(bc->JavaApplets)));
 Response->Write(String::Format(S"Supports ActiveX Controls = {0}<br>", __box(bc->ActiveXControls)));
 Response->Write(String::Format(S"CDF = {0}<br>", __box(bc->CDF)));
    

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

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace

Show:
© 2015 Microsoft