HttpCapabilitiesBase Class
TOC
Collapse the table of content
Expand the table of content

HttpCapabilitiesBase Class

 

Provides access to detailed information about the capabilities of the client's browser.

Namespace:   System.Web.Configuration
Assembly:  System.Web (in System.Web.dll)

System.Object
  System.Web.Configuration.HttpCapabilitiesBase
    System.Web.HttpBrowserCapabilities

public class HttpCapabilitiesBase : IFilterResolutionService

NameDescription
System_CAPS_pubmethodHttpCapabilitiesBase()

Creates a new instance of the HttpCapabilitiesBase class.

NameDescription
System_CAPS_pubpropertyActiveXControls

Gets a value indicating whether the browser supports ActiveX controls.

System_CAPS_pubpropertyAdapters

This API supports the product infrastructure and is not intended to be used directly from your code. Returns the collection of available control adapters.

System_CAPS_pubpropertyAOL

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

System_CAPS_pubpropertyBackgroundSounds

Gets a value indicating whether the browser supports playing background sounds using the <bgsounds> HTML element.

System_CAPS_pubpropertyBeta

Gets a value indicating whether the browser is a beta version.

System_CAPS_pubpropertyBrowser

Gets the browser string (if any) that was sent by the browser in the User-Agent request header.

System_CAPS_pubpropertySystem_CAPS_staticBrowserCapabilitiesProvider

Gets or sets the HttpCapabilitiesProvider object for the current browser.

System_CAPS_pubpropertyBrowsers

Gets an ArrayList of the browsers in the Capabilities dictionary.

System_CAPS_pubpropertyCanCombineFormsInDeck

Gets a value indicating whether the browser supports decks that contain multiple forms, such as separate cards.

System_CAPS_pubpropertyCanInitiateVoiceCall

Gets a value indicating whether the browser device is capable of initiating a voice call.

System_CAPS_pubpropertyCanRenderAfterInputOrSelectElement

Gets a value indicating whether the browser supports page content following WML <select> or <input> elements.

System_CAPS_pubpropertyCanRenderEmptySelects

Gets a value indicating whether the browser supports empty HTML <select> elements.

System_CAPS_pubpropertyCanRenderInputAndSelectElementsTogether

Gets a value indicating whether the browser supports WML INPUT and SELECT elements together on the same card.

System_CAPS_pubpropertyCanRenderMixedSelects

Gets a value indicating whether the browser supports WML <option> elements that specify both onpick and value attributes.

System_CAPS_pubpropertyCanRenderOneventAndPrevElementsTogether

Gets a value indicating whether the browser supports WML <onevent> and <prev> elements that coexist within the same WML card.

System_CAPS_pubpropertyCanRenderPostBackCards

Gets a value indicating whether the browser supports WML cards for postback.

System_CAPS_pubpropertyCanRenderSetvarZeroWithMultiSelectionList

Gets a value indicating whether the browser supports WML <setvar> elements with a value attribute of 0.

System_CAPS_pubpropertyCanSendMail

Gets a value indicating whether the browser supports sending e-mail by using the HTML <mailto> element for displaying electronic addresses.

System_CAPS_pubpropertyCapabilities

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to get the defined capabilities of the browser.

System_CAPS_pubpropertyCDF

Gets a value indicating whether the browser supports Channel Definition Format (CDF) for webcasting.

System_CAPS_pubpropertyClrVersion

Gets the version of the .NET Framework that is installed on the client.

System_CAPS_pubpropertyCookies

Gets a value indicating whether the browser supports cookies.

System_CAPS_pubpropertyCrawler

Gets a value indicating whether the browser is a search engine Web crawler.

System_CAPS_pubpropertyDefaultSubmitButtonLimit

Returns the maximum number of Submit buttons that are allowed for a form.

System_CAPS_pubpropertyEcmaScriptVersion

Gets the version number of ECMAScript that the browser supports.

System_CAPS_pubpropertyFrames

Gets a value indicating whether the browser supports HTML frames.

System_CAPS_pubpropertyGatewayMajorVersion

Gets the major version number of the wireless gateway used to access the server, if known.

System_CAPS_pubpropertyGatewayMinorVersion

Gets the minor version number of the wireless gateway used to access the server, if known.

System_CAPS_pubpropertyGatewayVersion

Gets the version of the wireless gateway used to access the server, if known.

System_CAPS_pubpropertyHasBackButton

Gets a value indicating whether the browser has a dedicated Back button.

System_CAPS_pubpropertyHidesRightAlignedMultiselectScrollbars

Gets a value indicating whether the scrollbar of an HTML <select multiple> element with an align attribute value of right is obscured upon rendering.

System_CAPS_pubpropertyHtmlTextWriter

Gets or sets the fully qualified class name of the HtmlTextWriter to use.

System_CAPS_pubpropertyId

Gets the internal identifier of the browser as specified in the browser definition file.

System_CAPS_pubpropertyInputType

Returns the type of input supported by browser.

System_CAPS_pubpropertyIsColor

Gets a value indicating whether the browser has a color display.

System_CAPS_pubpropertyIsMobileDevice

Gets a value indicating whether the browser is a recognized mobile device.

System_CAPS_pubpropertyItem[String]

Gets the value of the specified browser capability. In C#, this property is the indexer for the class.

System_CAPS_pubpropertyJavaApplets

Gets a value indicating whether the browser supports Java.

System_CAPS_pubpropertyJavaScript

Obsolete.Gets a value indicating whether the browser supports JavaScript.

System_CAPS_pubpropertyJScriptVersion

Gets the JScript version that the browser supports.

System_CAPS_pubpropertyMajorVersion

Gets the major (integer) version number of the browser.

System_CAPS_pubpropertyMaximumHrefLength

Gets the maximum length in characters for the href attribute of an HTML <a> (anchor) element.

System_CAPS_pubpropertyMaximumRenderedPageSize

Gets the maximum length of the page, in bytes, which the browser can display.

System_CAPS_pubpropertyMaximumSoftkeyLabelLength

Returns the maximum length of the text that a soft-key label can display.

System_CAPS_pubpropertyMinorVersion

Gets the minor (that is, decimal) version number of the browser.

System_CAPS_pubpropertyMinorVersionString

Gets the minor (decimal) version number of the browser as a string.

System_CAPS_pubpropertyMobileDeviceManufacturer

Returns the name of the manufacturer of a mobile device, if known.

System_CAPS_pubpropertyMobileDeviceModel

Gets the model name of a mobile device, if known.

System_CAPS_pubpropertyMSDomVersion

Gets the version of Microsoft HTML (MSHTML) Document Object Model (DOM) that the browser supports.

System_CAPS_pubpropertyNumberOfSoftkeys

Returns the number of soft keys on a mobile device.

System_CAPS_pubpropertyPlatform

Gets the name of the platform that the client uses, if it is known.

System_CAPS_pubpropertyPreferredImageMime

Returns the MIME type of the type of image content typically preferred by the browser.

System_CAPS_pubpropertyPreferredRenderingMime

Returns the MIME type of the type of content typically preferred by the browser.

System_CAPS_pubpropertyPreferredRenderingType

Gets the general name for the type of content that the browser prefers.

System_CAPS_pubpropertyPreferredRequestEncoding

Gets the request encoding preferred by the browser.

System_CAPS_pubpropertyPreferredResponseEncoding

Gets the response encoding preferred by the browser.

System_CAPS_pubpropertyRendersBreakBeforeWmlSelectAndInput

Gets a value indicating whether the browser renders a line break before <select> or <input> elements.

System_CAPS_pubpropertyRendersBreaksAfterHtmlLists

Gets a value indicating whether the browser renders a line break after list-item elements.

System_CAPS_pubpropertyRendersBreaksAfterWmlAnchor

Gets a value indicating whether the browser renders a line break after a stand-alone HTML <a> (anchor) element.

System_CAPS_pubpropertyRendersBreaksAfterWmlInput

Gets a value indicating whether the browser renders a line break after an HTML <input> element.

System_CAPS_pubpropertyRendersWmlDoAcceptsInline

Gets a value indicating whether the mobile-device browser renders a WML do-based form accept construct as an inline button rather than as a soft key.

System_CAPS_pubpropertyRendersWmlSelectsAsMenuCards

Gets a value indicating whether the browser renders WML <select> elements as menu cards, rather than as a combo box.

System_CAPS_pubpropertyRequiredMetaTagNameValue

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to produce a meta-tag required by some browsers.

System_CAPS_pubpropertyRequiresAttributeColonSubstitution

Gets a value indicating whether the browser requires colons in element attribute values to be substituted with a different character.

System_CAPS_pubpropertyRequiresContentTypeMetaTag

Gets a value indicating whether the browser requires an HTML <meta> element for which the content-type attribute is specified.

System_CAPS_pubpropertyRequiresControlStateInSession

Gets a value indicating whether the browser requires control state to be maintained in sessions.

System_CAPS_pubpropertyRequiresDBCSCharacter

Gets a value indicating whether the browser requires a double-byte character set.

System_CAPS_pubpropertyRequiresHtmlAdaptiveErrorReporting

Gets a value indicating whether the browser requires nonstandard error messages.

System_CAPS_pubpropertyRequiresLeadingPageBreak

Gets a value indicating whether the browser requires the first element in the body of a Web page to be an HTML <br> element.

System_CAPS_pubpropertyRequiresNoBreakInFormatting

Gets a value indicating whether the browser does not support HTML <br> elements to format line breaks.

System_CAPS_pubpropertyRequiresOutputOptimization

Gets a value indicating whether the browser requires pages to contain a size-optimized form of markup language tags.

System_CAPS_pubpropertyRequiresPhoneNumbersAsPlainText

Gets a value indicating whether the browser supports phone dialing based on plain text, or whether it requires special markup.

System_CAPS_pubpropertyRequiresSpecialViewStateEncoding

Gets a value indicating whether the browser requires VIEWSTATE values to be specially encoded.

System_CAPS_pubpropertyRequiresUniqueFilePathSuffix

Gets a value indicating whether the browser requires unique form-action URLs.

System_CAPS_pubpropertyRequiresUniqueHtmlCheckboxNames

Gets a value indicating whether the browser requires unique name attribute values of multiple HTML <input type="checkbox"> elements.

System_CAPS_pubpropertyRequiresUniqueHtmlInputNames

Gets a value indicating whether the browser requires unique name attribute values of multiple HTML <input> elements.

System_CAPS_pubpropertyRequiresUrlEncodedPostfieldValues

Gets a value indicating whether postback data sent by the browser will be UrlEncoded.

System_CAPS_pubpropertyScreenBitDepth

Returns the depth of the display, in bits per pixel.

System_CAPS_pubpropertyScreenCharactersHeight

Returns the approximate height of the display, in character lines.

System_CAPS_pubpropertyScreenCharactersWidth

Returns the approximate width of the display, in characters.

System_CAPS_pubpropertyScreenPixelsHeight

Returns the approximate height of the display, in pixels.

System_CAPS_pubpropertyScreenPixelsWidth

Returns the approximate width of the display, in pixels.

System_CAPS_pubpropertySupportsAccesskeyAttribute

Gets a value indicating whether the browser supports the ACCESSKEY attribute of HTML <a> (anchor) and <input> elements.

System_CAPS_pubpropertySupportsBodyColor

Gets a value indicating whether the browser supports the bgcolor attribute of the HTML <body> element.

System_CAPS_pubpropertySupportsBold

Gets a value indicating whether the browser supports HTML <b> elements to format bold text.

System_CAPS_pubpropertySupportsCacheControlMetaTag

Gets a value indicating whether the browser supports the cache-control value for the http-equiv attribute of HTML <meta> elements.

System_CAPS_pubpropertySupportsCallback

Gets a value indicating whether the browser supports callback scripts.

System_CAPS_pubpropertySupportsCss

Gets a value indicating whether the browser supports Cascading Style Sheets (CSS).

System_CAPS_pubpropertySupportsDivAlign

Gets a value indicating whether the browser supports the align attribute of HTML <div> elements.

System_CAPS_pubpropertySupportsDivNoWrap

Gets a value indicating whether the browser supports the nowrap attribute of HTML <div> elements.

System_CAPS_pubpropertySupportsEmptyStringInCookieValue

Gets a value indicating whether the browser supports empty (null) strings in cookie values.

System_CAPS_pubpropertySupportsFontColor

Gets a value indicating whether the browser supports the color attribute of HTML <font> elements.

System_CAPS_pubpropertySupportsFontName

Gets a value indicating whether the browser supports the name attribute of HTML <font> elements.

System_CAPS_pubpropertySupportsFontSize

Gets a value indicating whether the browser supports the size attribute of HTML <font> elements.

System_CAPS_pubpropertySupportsImageSubmit

Gets a value indicating whether the browser supports using a custom image in place of a standard form Submit button.

System_CAPS_pubpropertySupportsIModeSymbols

Gets a value indicating whether the browser supports i-mode symbols.

System_CAPS_pubpropertySupportsInputIStyle

Gets a value indicating whether the browser supports the istyle attribute of HTML <input> elements.

System_CAPS_pubpropertySupportsInputMode

Gets a value indicating whether the browser supports the mode attribute of HTML <input> elements.

System_CAPS_pubpropertySupportsItalic

Gets a value indicating whether the browser supports HTML <i> elements to format italic text.

System_CAPS_pubpropertySupportsJPhoneMultiMediaAttributes

Gets a value indicating whether the browser supports J-Phone multimedia attributes.

System_CAPS_pubpropertySupportsJPhoneSymbols

Gets a value indicating whether the browser supports J-Phone–specific picture symbols.

System_CAPS_pubpropertySupportsQueryStringInFormAction

Gets a value indicating whether the browser supports a query string in the action attribute value of HTML <form> elements.

System_CAPS_pubpropertySupportsRedirectWithCookie

Gets a value indicating whether the browser supports cookies on redirection.

System_CAPS_pubpropertySupportsSelectMultiple

Gets a value indicating whether the browser supports the multiple attribute of HTML <select> elements.

System_CAPS_pubpropertySupportsUncheck

Gets a value indicating whether the clearing of a checked HTML <input type=checkbox> element is reflected in postback data.

System_CAPS_pubpropertySupportsXmlHttp

Gets a value indicating whether the browser supports receiving XML over HTTP.

System_CAPS_pubpropertyTables

Gets a value indicating whether the browser supports HTML <table> elements.

System_CAPS_pubpropertyTagWriter

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to get the type of the object that is used to write tags for the browser.

System_CAPS_pubpropertyType

Gets the name and major (integer) version number of the browser.

System_CAPS_pubpropertyUseOptimizedCacheKey

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to get a value indicating whether to use an optimized cache key.

System_CAPS_pubpropertyVBScript

Gets a value indicating whether the browser supports Visual Basic Scripting edition (VBScript).

System_CAPS_pubpropertyVersion

Gets the full version number (integer and decimal) of the browser as a string.

System_CAPS_pubpropertyW3CDomVersion

Gets the version of the World Wide Web Consortium (W3C) XML Document Object Model (DOM) that the browser supports.

System_CAPS_pubpropertyWin16

Gets a value indicating whether the client is a Win16-based computer.

System_CAPS_pubpropertyWin32

Gets a value indicating whether the client is a Win32-based computer.

NameDescription
System_CAPS_pubmethodAddBrowser(String)

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to add an entry to the internal collection of browsers for which capabilities are recognized.

System_CAPS_pubmethodCreateHtmlTextWriter(TextWriter)

Creates a new instance of the HtmlTextWriter to be used.

System_CAPS_pubmethodDisableOptimizedCacheKey()

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to disable use of an optimized cache key.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetClrVersions()

Returns all versions of the .NET Framework common language runtime that are installed on the client.

System_CAPS_pubmethodSystem_CAPS_staticGetConfigCapabilities(String, HttpRequest)

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to return an instance of HttpCapabilitiesBase representing the browser that generated the specified HttpRequest.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodInit()

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to initialize an internal set of values.

System_CAPS_pubmethodIsBrowser(String)

Gets a value indicating whether the client browser is the same as the specified browser.

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodIFilterResolutionService.CompareFilters(String, String)

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to compare filters.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIFilterResolutionService.EvaluateFilter(String)

This API supports the product infrastructure and is not intended to be used directly from your code. Used internally to evaluate a filter.

HttpCapabilitiesBase is the base class from which the HttpBrowserCapabilities class is derived. HttpCapabilitiesBase offers a large number of read-only properties that provide type-safe access to a browser's capabilities dictionary. You can access the HttpBrowserCapabilities class through the Browser property that is exposed by the ASP.NET HttpRequest.Browser property.

The following example shows how to access information about the browser.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
System.Web.HttpBrowserCapabilities bCaps;

    void Page_Load(Object Sender, EventArgs e)
    {
        bCaps = Request.Browser;
        OutputLabel.Text = TestCaps();
    }   

    String TestCaps()
    {
        StringBuilder sb = new StringBuilder();
        sb.AppendLine(TestActiveXControls());
        sb.AppendLine(TestAdapters());
        sb.AppendLine(TestAOL());
        sb.AppendLine(TestBackgroundSounds());
        sb.AppendLine(TestBeta());
        sb.AppendLine(TestBrowser());
        sb.AppendLine(TestBrowserID());
        sb.AppendLine(TestBrowsers());
        sb.AppendLine(TestCanCall());
        sb.AppendLine(TestCanRenderAfter());
        sb.AppendLine(TestCanRenderEmpty());
        sb.AppendLine(TestCanRenderInputSelectTogether());
        sb.AppendLine(TestCanRenderMixedSelects());
        sb.AppendLine(TestCanRenderOneventPrevTogether());
        sb.AppendLine(TestCanRenderPostBackCards());
        sb.AppendLine(TestCanRenderSetvar());
        sb.AppendLine(TestCanSendMail());
        sb.AppendLine(TestCDF());
        sb.AppendLine(TestCLRVersion());
        sb.AppendLine(TestCombineDeck());
        sb.AppendLine(TestDefaultSubmitButton());
        sb.AppendLine(TestECMAScriptVersion());
        sb.AppendLine(TestGatewayMajorVersion());
        sb.AppendLine(TestGatewayMinorVersion());
        sb.AppendLine(TestGatewayVersion());
        sb.AppendLine(TestHasBackButton());
        sb.AppendLine(TestHideRtAlignScrollBars());
        sb.AppendLine(TestInputType());
        sb.AppendLine(TestIsBrowser());
        sb.AppendLine(TestIsColor());
        sb.AppendLine(TestIsCrawler());
        sb.AppendLine(TestIsMobileDevice());
        sb.AppendLine(TestJavaScript());
        sb.AppendLine(TestJScriptVersion());
        sb.AppendLine(TestMajorVersion());
        sb.AppendLine(TestMaximumHrefLength());
        sb.AppendLine(TestMaximumRenderedPageSize());
        sb.AppendLine(TestMaximumSoftkeyLabelLength());
        sb.AppendLine(TestMinorVersion());
        sb.AppendLine(TestMinorVersionString());
        sb.AppendLine(TestMobileDeviceManufacturer());
        sb.AppendLine(TestMobileDeviceModel());
        sb.AppendLine(TestMSDomVersion());
        sb.AppendLine(TestNumberOfSoftKeys());
        sb.AppendLine(TestPlatform());
        sb.AppendLine(TestPreferredImageMime());
        sb.AppendLine(TestPreferredRenderingMime());
        sb.AppendLine(TestPreferredRenderingType());
        sb.AppendLine(TestPreferredRequestEncoding());
        sb.AppendLine(TestPreferredResponseEncoding());
        sb.AppendLine(TestRenderBreakBeforeWmlSelectAndInput());
        sb.AppendLine(TestRendersBreaksAfterHtmlLists());
        sb.AppendLine(TestRendersBreaksAfterWmlAnchor());
        sb.AppendLine(TestRendersBreaksAfterWmlInput());
        sb.AppendLine(TestRendersWmlDoAcceptsInline());
        sb.AppendLine(TestRendersWmlSelectsAsMenuCards());
        sb.AppendLine(TestRequiredMetaTagNameValue());
        sb.AppendLine(TestRequiresAttributeColonSubstitution());
        sb.AppendLine(TestRequiresContentTypeMetaTag());
        sb.AppendLine(TestRequiresControlStateInSession());
        sb.AppendLine(TestRequiresDBCSCharacter());
        sb.AppendLine(TestRequiresHtmlAdaptiveErrorReporting());
        sb.AppendLine(TestRequiresLeadingPageBreak());
        sb.AppendLine(TestRequiresNoBreakInFormatting());
        sb.AppendLine(TestRequiresOutputOptimization());
        sb.AppendLine(TestRequiresPhoneNumberAsPlainText());
        sb.AppendLine(TestRequiresSpecialViewStateEncoding());
        sb.AppendLine(TestRequiresUniqueFilePathSuffix());
        sb.AppendLine(TestRequiresUniqueHtmlCheckboxNames());
        sb.AppendLine(TestRequiresUniqueHtmlInputNames());
        sb.AppendLine(TestRequiresUrlEncodedPostfieldValues());
        sb.AppendLine(TestScreenBitDepth());
        sb.AppendLine(TestScreenCharactersHeight());
        sb.AppendLine(TestScreenCharactersWidth());
        sb.AppendLine(TestScreenPixelsHeight());
        sb.AppendLine(TestScreenPixelsWidth());
        sb.AppendLine(TestScreenAccesskeyAttribute());
        sb.AppendLine(TestSupportsBodyColor());
        sb.AppendLine(TestSupportsBold());
        sb.AppendLine(TestSupportsCacheControlMetaTag());
        sb.AppendLine(TestSupportsCallback());
        sb.AppendLine(TestSupportsCookies());
        sb.AppendLine(TestSupportsCss());
        sb.AppendLine(TestSupportsDivAlign());
        sb.AppendLine(TestSupportsDivNoWrap());
        sb.AppendLine(TestSupportsEmptyStringInCookieValue());
        sb.AppendLine(TestSupportsFontColor());
        sb.AppendLine(TestSupportsFontName());
        sb.AppendLine(TestSupportsFontSize());
        sb.AppendLine(TestSupportsFrames());
        sb.AppendLine(TestSupportsImageSubmit());
        sb.AppendLine(TestSupportsIModeSymbols());
        sb.AppendLine(TestSupportsInputIStyle());
        sb.AppendLine(TestSupportsInputMode());
        sb.AppendLine(TestSupportsItalic());
        sb.AppendLine(TestSupportsJava());
        sb.AppendLine(TestSupportsJPhoneMultiMediaAttributes());
        sb.AppendLine(TestSupportsJPhoneSymbols());
        sb.AppendLine(TestSupportsQueryStringInFormAction());
        sb.AppendLine(TestSupportsRedirectWithCookie());
        sb.AppendLine(TestSupportsSelectMultiple());
        sb.AppendLine(TestSupportsUncheck());
        sb.AppendLine(TestSupportsXmlHttp());
        sb.AppendLine(TestTables());
        sb.AppendLine(TestType());
        sb.AppendLine(TestVBScript());
        sb.AppendLine(TestVersion());
        sb.AppendLine(TestW3CDomVersion());
        sb.AppendLine(TestWin16());
        sb.AppendLine(TestWin32());
        return sb.ToString().Replace(Environment.NewLine,"<br />");
    }
    String TestActiveXControls() 
    {
        return String.Format("Supports ActiveX controls: {0}",
            bCaps.ActiveXControls); 
    }

    String TestAdapters()
    {
        return String.Format("Adapter count: {0}", 
            bCaps.Adapters.Count);
    }

    String TestAOL()
    {
        return String.Format("Is an AOL browser: {0}", 
            bCaps.AOL.ToString());
    }

    String TestBackgroundSounds()
    {
        return String.Format("Supports background sounds: {0}",
            bCaps.BackgroundSounds);
    }

    String TestBeta()
    {
        return String.Format("Is a beta version: {0}", 
            bCaps.Beta);
    }

    String TestBrowser()
    {
        return String.Format("Browser type: {0}", 
            bCaps.Browser);
    }

    String TestBrowsers()
    {
        return String.Format("Number of browsers in dictionary: {0}",
            bCaps.Browsers.Count);
    }

    String TestCombineDeck()
    {
        return String.Format("Can combine forms in deck: {0}",
            bCaps.CanCombineFormsInDeck);
    }

    String TestCanCall()
    {
        return String.Format("Can initiate voice call: {0}",
            bCaps.CanInitiateVoiceCall);
    }

    String TestCanRenderAfter()
    {
        return String.Format("Can render {0}: {1}",
            "after input or select element",
            bCaps.CanRenderAfterInputOrSelectElement);
    }

    String TestCanRenderEmpty()
    {
        return String.Format("Can render empty selects: {0}",
            bCaps.CanRenderEmptySelects);
    }

    String TestCanRenderInputSelectTogether()
    {
        return String.Format("Can render {0} together: {1}",
            "input and select elements",
            bCaps.CanRenderInputAndSelectElementsTogether);
    }

    String TestCanRenderMixedSelects()
    {
        return String.Format("Can render mixed selects: {0}",
            bCaps.CanRenderMixedSelects);
    }

    String TestCanRenderOneventPrevTogether()
    {
        return String.Format("Can render {0} together: {1}",
            "OnEvent and Prev elements",
            bCaps.CanRenderOneventAndPrevElementsTogether);
    }

    String TestCanRenderPostBackCards()
    {
        return String.Format("Can render postback cards: {0}",
            bCaps.CanRenderPostBackCards);
    }

    String TestCanRenderSetvar()
    {
        return String.Format("Can render {0}: {1}",
            "setvar elements with a value of 0",
            bCaps.CanRenderSetvarZeroWithMultiSelectionList);
    }

    String TestCanSendMail()
    {
        return String.Format("Can send mail: {0}",
            bCaps.CanSendMail);
    }

    String TestCDF()
    {
        return String.Format("Supports {0}: {1}",
            "Channel Definition Format",
            bCaps.CDF.ToString());
    }

    String TestCLRVersion()
    {
        return String.Format("CLR version on client: {0}",
            bCaps.ClrVersion);
    }

    String TestSupportsCookies()
    {
        return String.Format("Supports cookies: {0}",
            bCaps.Cookies);
    }

    String TestIsCrawler()
    {
        return String.Format("Is a crawler: {0}",
            bCaps.Crawler);
    }

    String TestDefaultSubmitButton()
    {
        return String.Format("Submit button limit: {0}",
            bCaps.DefaultSubmitButtonLimit);
    }

    String TestECMAScriptVersion()
    {
        return String.Format("ECMA script version: {0}",
            bCaps.EcmaScriptVersion);
    }

    String TestSupportsFrames()
    {
        return String.Format("Supports frames: {0}",
            bCaps.Frames);
    }

    String TestGatewayMajorVersion()
    {
        return String.Format("Gateway major version: {0}",
            bCaps.GatewayMajorVersion.ToString());
    }

    String TestGatewayMinorVersion()
    {
        return String.Format("Gateway minor version: {0}",
            bCaps.GatewayMinorVersion.ToString());
    }

    String TestGatewayVersion()
    {
        return String.Format("Gateway version: {0}",
            bCaps.GatewayVersion.ToString());
    }

    String TestHasBackButton()
    {
        return String.Format("Has back button: {0}",
            bCaps.HasBackButton.ToString());
    }

    String TestHideRtAlignScrollBars()
    {
        return String.Format("Hide right-aligned {0}: {1}",
            "multi-select scrollbars",
            bCaps.HidesRightAlignedMultiselectScrollbars.ToString());
    }

    String TestBrowserID()
    {
        return String.Format("Browser ID: {0}",
            bCaps.Id);
    }

    String TestInputType()
    {
        return String.Format("Supported input type: {0}",
            bCaps.InputType);
    }

    String TestIsBrowser()
    {
        return String.Format("Is client a given browser: {0}",
            bCaps.IsBrowser("IE").ToString());
    }

    String TestIsColor()
    {
        return String.Format("Is color display: {0}",
            bCaps.IsColor.ToString());
    }

    String TestIsMobileDevice()
    {
        return String.Format("Is mobile device: {0}",
            bCaps.IsMobileDevice.ToString());
    }

    String TestSupportsJava()
    {
        return String.Format("Supports Java: {0}",
            bCaps.JavaApplets.ToString());
    }

    String TestJavaScript()
    {
        return String.Format("Supports JavaScript: {0}",
            bCaps.JavaScript.ToString());
    }

    String TestJScriptVersion()
    {
        return String.Format("JScript version: {0}",
            bCaps.JScriptVersion.ToString());
    }

    String TestMajorVersion()
    {
        return String.Format("Major version of browser: {0}",
            bCaps.MajorVersion.ToString());
    }

    String TestMaximumHrefLength()
    {
        return String.Format("Max. href length: {0}",
            bCaps.MaximumHrefLength.ToString());
    }

    String TestMaximumRenderedPageSize()
    {
        return String.Format("Max. rendered page size in bytes: {0}",
            bCaps.MaximumRenderedPageSize.ToString());
    }

    String TestMaximumSoftkeyLabelLength()
    {
        return String.Format("Max. softkey label length: {0}",
            bCaps.MaximumSoftkeyLabelLength.ToString());
    }

    String TestMinorVersion()
    {
        return String.Format("Minor browser version: {0}",
            bCaps.MinorVersion.ToString());
    }

    String TestMinorVersionString()
    {
        return String.Format("Minor browser version {0}: {1}",
            "(as string)",
            bCaps.MinorVersionString);
    }

    String TestMobileDeviceManufacturer()
    {
        return String.Format("Mobile device manufacturer: {0}",
            bCaps.MobileDeviceManufacturer);
    }

    String TestMobileDeviceModel()
    {
        return String.Format("Mobile device model: {0}",
            bCaps.MobileDeviceModel);
    }

    String TestMSDomVersion()
    { 
        return String.Format("MS DOM version: {0}",
            bCaps.MSDomVersion.ToString());
    }

    String TestNumberOfSoftKeys()
    {
        return String.Format("Number of soft keys: {0}",
            bCaps.NumberOfSoftkeys.ToString());
    }

    String TestPlatform()
    {
        return String.Format("Platform of client: {0}",
            bCaps.Platform);
    }

    String TestPreferredImageMime()
    {
        return String.Format("Preferred image MIME: {0}",
            bCaps.PreferredImageMime);
    }

    String TestPreferredRenderingMime()
    {
        return String.Format("Preferred rendering MIME: {0}",
            bCaps.PreferredRenderingMime);
    }

    String TestPreferredRenderingType()
    {
        return String.Format("Preferred rendering type: {0}",
            bCaps.PreferredRenderingType);
    }

    String TestPreferredRequestEncoding()
    {
        return String.Format("Preferred request encoding: {0}",
            bCaps.PreferredRequestEncoding);
    }

    String TestPreferredResponseEncoding()
    {
        return String.Format("Preferred response encoding: {0}",
            bCaps.PreferredResponseEncoding);
    }

    String TestRenderBreakBeforeWmlSelectAndInput()
    {
        return String.Format("Renders {0}: {1}",
            "break before WML select/input",
            bCaps.RendersBreakBeforeWmlSelectAndInput.ToString());
    }

    String TestRendersBreaksAfterHtmlLists()
    {
        return String.Format("Renders breaks after HTML lists: {0}",
            bCaps.RendersBreaksAfterHtmlLists);
    }

    String TestRendersBreaksAfterWmlAnchor()
    {
        return String.Format("Renders breaks after Wml anchor: {0}",
            bCaps.RendersBreaksAfterWmlAnchor);
    }

    String TestRendersBreaksAfterWmlInput()
    {
        return String.Format("Renders breaks after Wml input: {0}",
            bCaps.RendersBreaksAfterWmlInput);
    }

    String TestRendersWmlDoAcceptsInline()
    {
        return String.Format("Renders Wml do accepts inline: {0}",
            bCaps.RendersWmlDoAcceptsInline);
    }

    String TestRendersWmlSelectsAsMenuCards()
    {
        return String.Format("Renders {0}: {1}",
            "break before WML select/input",
            bCaps.RendersWmlSelectsAsMenuCards);
    }

    String TestRequiredMetaTagNameValue()
    {
        return String.Format("Required meta tag name value: {0}",
            bCaps.RequiredMetaTagNameValue);
    }

    String TestRequiresAttributeColonSubstitution()
    {
        return String.Format("Requires {0}: {1}",
            "break before WML select/input",
            bCaps.RequiresAttributeColonSubstitution);
    }

    String TestRequiresContentTypeMetaTag()
    {
        return String.Format("Requires content type meta tag: {0}",
            bCaps.RequiresContentTypeMetaTag);
    }

    String TestRequiresControlStateInSession()
    {
        return String.Format("Requires {0}: {1}",
            "control state in session",
            bCaps.RequiresControlStateInSession);
    }

    String TestRequiresDBCSCharacter()
    {
        return String.Format("Requires DBCS character: {0}",
            bCaps.RequiresDBCSCharacter);
    }

    String TestRequiresHtmlAdaptiveErrorReporting()
    {
        return String.Format("Requires HTML adaptive error reporting: {0}",
            bCaps.RequiresHtmlAdaptiveErrorReporting);
    }

    String TestRequiresLeadingPageBreak()
    {
        return String.Format("Requires leading page break: {0}",
            bCaps.RequiresLeadingPageBreak);
    }

    String TestRequiresNoBreakInFormatting()
    {
        return String.Format("Requires no break in formatting: {0}",
            bCaps.RequiresNoBreakInFormatting);
    }

    String TestRequiresOutputOptimization()
    {
        return String.Format("Requires output optimization: {0}",
            bCaps.RequiresOutputOptimization);
    }

    String TestRequiresPhoneNumberAsPlainText()
    {
        return String.Format("Requires phone number as text: {0}",
            bCaps.RequiresPhoneNumbersAsPlainText);
    }

    String TestRequiresSpecialViewStateEncoding()
    {
        return String.Format("Requires special viewstate encoding: {0}",
            bCaps.RequiresSpecialViewStateEncoding);
    }

    String TestRequiresUniqueFilePathSuffix()
    {
        return String.Format("Requires unique file path suffix: {0}",
            bCaps.RequiresUniqueFilePathSuffix);
    }

    String TestRequiresUniqueHtmlCheckboxNames()
    {
        return String.Format("Requires unique HTML checkbox names: {0}",
            bCaps.RequiresUniqueHtmlCheckboxNames);
    }

    String TestRequiresUniqueHtmlInputNames()
    {
        return String.Format("Requires unique HTML input names: {0}",
            bCaps.RequiresUniqueHtmlInputNames);
    }

    String TestRequiresUrlEncodedPostfieldValues()
    {
        return String.Format("Requires URL encoded postfield values: {0}",
            bCaps.RequiresUrlEncodedPostfieldValues);
    }

    String TestScreenBitDepth()
    {
        return String.Format("Screen bit depth: {0}",
            bCaps.ScreenBitDepth);
    }

    String TestScreenCharactersHeight()
    {
        return String.Format("Screen height in character lines: {0}",
            bCaps.ScreenCharactersHeight);
    }

    String TestScreenCharactersWidth()
    {
        return String.Format("Screen width in characters: {0}",
            bCaps.ScreenCharactersWidth);
    }

    String TestScreenPixelsHeight()
    {
        return String.Format("Screen height in pixels: {0}",
            bCaps.ScreenPixelsHeight);
    }

    String TestScreenPixelsWidth()
    {
        return String.Format("Screen width in pixels: {0}",
            bCaps.ScreenPixelsWidth);
    }

    String TestScreenAccesskeyAttribute()
    {
        return String.Format("Supports ACCESSKEY: {0}",
            bCaps.SupportsAccesskeyAttribute);
    }

    String TestSupportsBodyColor()
    {
        return String.Format("Supports body color: {0}",
            bCaps.SupportsBodyColor);
    }

    String TestSupportsBold()
    {
        return String.Format("Supports bold: {0}",
            bCaps.SupportsBold);
    }

    String TestSupportsCacheControlMetaTag()
    {
        return String.Format("Supports cache-control meta tag: {0}",
            bCaps.SupportsCacheControlMetaTag);
    }

    String TestSupportsCallback()
    {
        return String.Format("Supports callback: {0}",
            bCaps.SupportsCallback);
    }

    String TestSupportsCss()
    {
        return String.Format("Supports CSS: {0}",
            bCaps.SupportsCss);
    }

    String TestSupportsDivAlign()
    {
        return String.Format("Supports DIV align: {0}",
            bCaps.SupportsDivAlign);
    }

    String TestSupportsDivNoWrap()
    {
        return String.Format("Supports DIV nowrap: {0}",
            bCaps.SupportsDivNoWrap);
    }

    String TestSupportsEmptyStringInCookieValue()
    {
        return String.Format("Supports empty string in cookie value: {0}",
            bCaps.SupportsEmptyStringInCookieValue);
    }

    String TestSupportsFontColor()
    {
        return String.Format("Supports font color: {0}",
            bCaps.SupportsFontColor);
    }

    String TestSupportsFontName()
    {
        return String.Format("Supports font name: {0}",
            bCaps.SupportsFontName);
    }

    String TestSupportsFontSize()
    {
        return String.Format("Supports font size: {0}",
            bCaps.SupportsFontSize);
    }

    String TestSupportsImageSubmit()
    {
        return String.Format("Supports image submit: {0}",
            bCaps.SupportsImageSubmit);
    }

    String TestSupportsIModeSymbols()
    {
        return String.Format("Supports i-mode symbols: {0}",
            bCaps.SupportsIModeSymbols);
    }

    String TestSupportsInputIStyle()
    {
        return String.Format("Supports input istyle attribute: {0}",
            bCaps.SupportsInputIStyle);
    }

    String TestSupportsInputMode()
    {
        return String.Format("Supports input mode: {0}",
            bCaps.SupportsInputMode);
    }

    String TestSupportsItalic()
    {
        return String.Format("Supports italics: {0}",
            bCaps.SupportsItalic);
    }

    String TestSupportsJPhoneMultiMediaAttributes()
    {
        return String.Format("Supports JPhone multimedia attributes: {0}",
            bCaps.SupportsJPhoneMultiMediaAttributes);
    }

    String TestSupportsJPhoneSymbols()
    {
        return String.Format("Supports JPhone picture symbols: {0}",
            bCaps.SupportsJPhoneSymbols);
    }

    String TestSupportsQueryStringInFormAction()
    {
        return String.Format("Supports querystring in form action: {0}",
            bCaps.SupportsQueryStringInFormAction);
    }

    String TestSupportsRedirectWithCookie()
    {
        return String.Format("Supports redirect with cookie: {0}",
            bCaps.SupportsRedirectWithCookie);
    }

    String TestSupportsSelectMultiple()
    {
        return String.Format("Supports select multiple: {0}",
            bCaps.SupportsSelectMultiple);
    }

    String TestSupportsUncheck()
    {
        return String.Format("Supports uncheck: {0}",
            bCaps.SupportsUncheck);
    }

    String TestSupportsXmlHttp()
    {
        return String.Format("Supports receiving XML over HTTP: {0}",
            bCaps.SupportsXmlHttp);
    }

    String TestTables()
    {
        return String.Format("Supports tables: {0}",
            bCaps.Tables);
    }

    String TestType()
    {
        return String.Format("Gets the browser name/version: {0}",
            bCaps.Type);
    }

    String TestVBScript()
    {
        return String.Format("Supports VBScript: {0}",
            bCaps.VBScript);
    }

    String TestVersion()
    {
        string dVer = bCaps.MajorVersion + "." + bCaps.MinorVersion;
        if (Double.Parse(dVer) > 5.01)
        {
            return String.Format("Uplevel version: {0}",
                bCaps.Version);
        }
        else
        {
            return String.Format("Old version: {0}",
                bCaps.Version);
        }
    }

    String TestW3CDomVersion()
    {
        return String.Format("W3C DOM version: {0}",
            bCaps.W3CDomVersion);
    }

    String TestWin16()
    {
        return String.Format("Is Win16-based computer: {0}",
            bCaps.Win16);
    }

    String TestWin32()
    {
        return String.Format("Is Win32-based computer: {0}",
            bCaps.Win32);
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Browser Capabilities Sample</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        The current browser has the following capabilities:
        <br />
        <asp:Label ID="OutputLabel" runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft