MobileCapabilities MobileCapabilities MobileCapabilities MobileCapabilities Class

Definition

Warning

This API is now obsolete.

Provides a single source for accessing capability information about a client device and for performing queries against device capabilities. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public ref class MobileCapabilities : System::Web::HttpBrowserCapabilities
[System.Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")]
public class MobileCapabilities : System.Web.HttpBrowserCapabilities
type MobileCapabilities = class
    inherit HttpBrowserCapabilities
Public Class MobileCapabilities
Inherits HttpBrowserCapabilities
Inheritance
Attributes

Examples

During the page load, the MobileCapabilities object obtains the capabilities through the Browser property as previously discussed. The PreferredRenderingMime and the ScreenCharactersWidth properties of the MobileCapabilities object report back to the browser by setting properties on the HttpResponse object and also by programmatically setting the Text property of certain controls on the page.

<%@ Page Inherits="System.Web.UI.MobileControls.MobilePage"   
    Language="c#" %>  
<script language="c#" runat="server">  
public void Page_Load(Object sender, EventArgs e)  
{  
    System.Web.Mobile.MobileCapabilities currentCapabilities;  
    MobileCapabilities currentCapabilities =   
        (MobileCapabilities)Request.Browser;  
    // Programmatically find the mobile capabilities without using   
    // DeviceSpecific Filters.  
    if(currentCapabilities.PreferredRenderingMIME=="text/html")  
    {  
        Label2.Text = "You are using an html supported device.";  
    }  
    else if(currentCapabilities.PreferredRenderingMIME ==   
        "text/vnd.wap.wml")  
    {  
        Label2.Text = "You are using a wml supported device.";  
    }  
    Label1.Text = "Screen Width (chars): " +   
        currentCapabilities.ScreenCharactersWidth;  
 }  
 </script>  
 <Mobile:Form runat="server" id=frmTemplate >  
      <mobile:label ID="Label1" runat="server" />  
      <mobile:label ID="Label2" runat="server" />  
 </Mobile:Form>  

Remarks

The MobileCapabilities class extends the HttpBrowserCapabilities class. The MobileCapabilities class offers a large number of read-only properties that provide type-safe access to the Browser object's capabilities dictionary.

You can use the Browser property of the HttpRequest object to point to an instance of a MobileCapabilities object, which can then be used to read the capabilities of the requesting browser and device.

Constructors

MobileCapabilities() MobileCapabilities() MobileCapabilities() MobileCapabilities()

Creates an instance of the MobileCapabilities class. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

Fields

PreferredRenderingTypeChtml10 PreferredRenderingTypeChtml10 PreferredRenderingTypeChtml10 PreferredRenderingTypeChtml10

Returns the source identifier to use for compact HTML 1.0. This field is read-only. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

PreferredRenderingTypeHtml32 PreferredRenderingTypeHtml32 PreferredRenderingTypeHtml32 PreferredRenderingTypeHtml32

Returns the source identifier to use for HTML 3.2. This field is read-only. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

PreferredRenderingTypeWml11 PreferredRenderingTypeWml11 PreferredRenderingTypeWml11 PreferredRenderingTypeWml11

Returns the source identifier to use for WML 1.1. This field is read-only. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

PreferredRenderingTypeWml12 PreferredRenderingTypeWml12 PreferredRenderingTypeWml12 PreferredRenderingTypeWml12

Returns the source identifier to use for WML 1.2. This field is read-only. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

Properties

ActiveXControls ActiveXControls ActiveXControls ActiveXControls

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

(Inherited from HttpBrowserCapabilities)
Adapters Adapters Adapters Adapters

Returns the collection of available control adapters.

(Inherited from HttpCapabilitiesBase)
AOL AOL AOL AOL

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

(Inherited from HttpBrowserCapabilities)
BackgroundSounds BackgroundSounds BackgroundSounds BackgroundSounds

Gets a value indicating whether the client browser supports background sounds.

(Inherited from HttpBrowserCapabilities)
Beta Beta Beta Beta

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

(Inherited from HttpBrowserCapabilities)
Browser Browser Browser Browser

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

(Inherited from HttpBrowserCapabilities)
Browsers Browsers Browsers Browsers

Gets an ArrayList of the browsers in the Capabilities dictionary.

(Inherited from HttpCapabilitiesBase)
CanCombineFormsInDeck CanCombineFormsInDeck CanCombineFormsInDeck CanCombineFormsInDeck
CanInitiateVoiceCall CanInitiateVoiceCall CanInitiateVoiceCall CanInitiateVoiceCall
CanRenderAfterInputOrSelectElement CanRenderAfterInputOrSelectElement CanRenderAfterInputOrSelectElement CanRenderAfterInputOrSelectElement
CanRenderEmptySelects CanRenderEmptySelects CanRenderEmptySelects CanRenderEmptySelects
CanRenderInputAndSelectElementsTogether CanRenderInputAndSelectElementsTogether CanRenderInputAndSelectElementsTogether CanRenderInputAndSelectElementsTogether
CanRenderMixedSelects CanRenderMixedSelects CanRenderMixedSelects CanRenderMixedSelects
CanRenderOneventAndPrevElementsTogether CanRenderOneventAndPrevElementsTogether CanRenderOneventAndPrevElementsTogether CanRenderOneventAndPrevElementsTogether
CanRenderPostBackCards CanRenderPostBackCards CanRenderPostBackCards CanRenderPostBackCards
CanRenderSetvarZeroWithMultiSelectionList CanRenderSetvarZeroWithMultiSelectionList CanRenderSetvarZeroWithMultiSelectionList CanRenderSetvarZeroWithMultiSelectionList
CanSendMail CanSendMail CanSendMail CanSendMail
Capabilities Capabilities Capabilities Capabilities

Used internally to get the defined capabilities of the browser.

(Inherited from HttpCapabilitiesBase)
CDF CDF CDF CDF

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

(Inherited from HttpBrowserCapabilities)
ClrVersion ClrVersion ClrVersion ClrVersion

Gets the version number of the .NET common language runtime installed on the client.

(Inherited from HttpBrowserCapabilities)
Cookies Cookies Cookies Cookies

Gets a value indicating whether the client browser supports cookies.

(Inherited from HttpBrowserCapabilities)
Crawler Crawler Crawler Crawler

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

(Inherited from HttpBrowserCapabilities)
DefaultSubmitButtonLimit DefaultSubmitButtonLimit DefaultSubmitButtonLimit DefaultSubmitButtonLimit
EcmaScriptVersion EcmaScriptVersion EcmaScriptVersion EcmaScriptVersion

Gets the version number of ECMA script that the client browser supports.

(Inherited from HttpBrowserCapabilities)
Frames Frames Frames Frames

Gets a value indicating whether the client browser supports HTML frames.

(Inherited from HttpBrowserCapabilities)
GatewayMajorVersion GatewayMajorVersion GatewayMajorVersion GatewayMajorVersion
GatewayMinorVersion GatewayMinorVersion GatewayMinorVersion GatewayMinorVersion
GatewayVersion GatewayVersion GatewayVersion GatewayVersion
HasBackButton HasBackButton HasBackButton HasBackButton
HidesRightAlignedMultiselectScrollbars HidesRightAlignedMultiselectScrollbars HidesRightAlignedMultiselectScrollbars HidesRightAlignedMultiselectScrollbars
HtmlTextWriter HtmlTextWriter HtmlTextWriter HtmlTextWriter

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

(Inherited from HttpCapabilitiesBase)
Id Id Id Id

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

(Inherited from HttpCapabilitiesBase)
InputType InputType InputType InputType
IsColor IsColor IsColor IsColor
IsMobileDevice IsMobileDevice IsMobileDevice IsMobileDevice
Item[String] Item[String] Item[String] Item[String]

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

(Inherited from HttpCapabilitiesBase)
JavaApplets JavaApplets JavaApplets JavaApplets

Gets a value indicating whether the client browser supports Java applets.

(Inherited from HttpBrowserCapabilities)
JavaScript JavaScript JavaScript JavaScript

Gets a value indicating whether the client browser supports JavaScript.

(Inherited from HttpBrowserCapabilities)
JScriptVersion JScriptVersion JScriptVersion JScriptVersion

Gets the JScript version that the browser supports.

(Inherited from HttpCapabilitiesBase)
MajorVersion MajorVersion MajorVersion MajorVersion

Gets the major (that is, integer) version number of the client browser.

(Inherited from HttpBrowserCapabilities)
MaximumHrefLength MaximumHrefLength MaximumHrefLength MaximumHrefLength

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

(Inherited from HttpCapabilitiesBase)
MaximumRenderedPageSize MaximumRenderedPageSize MaximumRenderedPageSize MaximumRenderedPageSize
MaximumSoftkeyLabelLength MaximumSoftkeyLabelLength MaximumSoftkeyLabelLength MaximumSoftkeyLabelLength
MinorVersion MinorVersion MinorVersion MinorVersion

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

(Inherited from HttpBrowserCapabilities)
MinorVersionString MinorVersionString MinorVersionString MinorVersionString

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

(Inherited from HttpCapabilitiesBase)
MobileDeviceManufacturer MobileDeviceManufacturer MobileDeviceManufacturer MobileDeviceManufacturer
MobileDeviceModel MobileDeviceModel MobileDeviceModel MobileDeviceModel
MSDomVersion MSDomVersion MSDomVersion MSDomVersion

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

(Inherited from HttpBrowserCapabilities)
NumberOfSoftkeys NumberOfSoftkeys NumberOfSoftkeys NumberOfSoftkeys
Platform Platform Platform Platform

Gets the name of the platform that the client uses.

(Inherited from HttpBrowserCapabilities)
PreferredImageMime PreferredImageMime PreferredImageMime PreferredImageMime
PreferredRenderingMime PreferredRenderingMime PreferredRenderingMime PreferredRenderingMime
PreferredRenderingType PreferredRenderingType PreferredRenderingType PreferredRenderingType
PreferredRequestEncoding PreferredRequestEncoding PreferredRequestEncoding PreferredRequestEncoding

Gets the request encoding preferred by the browser.

(Inherited from HttpCapabilitiesBase)
PreferredResponseEncoding PreferredResponseEncoding PreferredResponseEncoding PreferredResponseEncoding

Gets the response encoding preferred by the browser.

(Inherited from HttpCapabilitiesBase)
RendersBreakBeforeWmlSelectAndInput RendersBreakBeforeWmlSelectAndInput RendersBreakBeforeWmlSelectAndInput RendersBreakBeforeWmlSelectAndInput
RendersBreaksAfterHtmlLists RendersBreaksAfterHtmlLists RendersBreaksAfterHtmlLists RendersBreaksAfterHtmlLists
RendersBreaksAfterWmlAnchor RendersBreaksAfterWmlAnchor RendersBreaksAfterWmlAnchor RendersBreaksAfterWmlAnchor
RendersBreaksAfterWmlInput RendersBreaksAfterWmlInput RendersBreaksAfterWmlInput RendersBreaksAfterWmlInput
RendersWmlDoAcceptsInline RendersWmlDoAcceptsInline RendersWmlDoAcceptsInline RendersWmlDoAcceptsInline
RendersWmlSelectsAsMenuCards RendersWmlSelectsAsMenuCards RendersWmlSelectsAsMenuCards RendersWmlSelectsAsMenuCards
RequiredMetaTagNameValue RequiredMetaTagNameValue RequiredMetaTagNameValue RequiredMetaTagNameValue
RequiresAttributeColonSubstitution RequiresAttributeColonSubstitution RequiresAttributeColonSubstitution RequiresAttributeColonSubstitution
RequiresContentTypeMetaTag RequiresContentTypeMetaTag RequiresContentTypeMetaTag RequiresContentTypeMetaTag
RequiresControlStateInSession RequiresControlStateInSession RequiresControlStateInSession RequiresControlStateInSession

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

(Inherited from HttpCapabilitiesBase)
RequiresDBCSCharacter RequiresDBCSCharacter RequiresDBCSCharacter RequiresDBCSCharacter
RequiresHtmlAdaptiveErrorReporting RequiresHtmlAdaptiveErrorReporting RequiresHtmlAdaptiveErrorReporting RequiresHtmlAdaptiveErrorReporting
RequiresLeadingPageBreak RequiresLeadingPageBreak RequiresLeadingPageBreak RequiresLeadingPageBreak
RequiresNoBreakInFormatting RequiresNoBreakInFormatting RequiresNoBreakInFormatting RequiresNoBreakInFormatting
RequiresOutputOptimization RequiresOutputOptimization RequiresOutputOptimization RequiresOutputOptimization
RequiresPhoneNumbersAsPlainText RequiresPhoneNumbersAsPlainText RequiresPhoneNumbersAsPlainText RequiresPhoneNumbersAsPlainText
RequiresSpecialViewStateEncoding RequiresSpecialViewStateEncoding RequiresSpecialViewStateEncoding RequiresSpecialViewStateEncoding
RequiresUniqueFilePathSuffix RequiresUniqueFilePathSuffix RequiresUniqueFilePathSuffix RequiresUniqueFilePathSuffix
RequiresUniqueHtmlCheckboxNames RequiresUniqueHtmlCheckboxNames RequiresUniqueHtmlCheckboxNames RequiresUniqueHtmlCheckboxNames
RequiresUniqueHtmlInputNames RequiresUniqueHtmlInputNames RequiresUniqueHtmlInputNames RequiresUniqueHtmlInputNames
RequiresUrlEncodedPostfieldValues RequiresUrlEncodedPostfieldValues RequiresUrlEncodedPostfieldValues RequiresUrlEncodedPostfieldValues
ScreenBitDepth ScreenBitDepth ScreenBitDepth ScreenBitDepth
ScreenCharactersHeight ScreenCharactersHeight ScreenCharactersHeight ScreenCharactersHeight
ScreenCharactersWidth ScreenCharactersWidth ScreenCharactersWidth ScreenCharactersWidth
ScreenPixelsHeight ScreenPixelsHeight ScreenPixelsHeight ScreenPixelsHeight
ScreenPixelsWidth ScreenPixelsWidth ScreenPixelsWidth ScreenPixelsWidth
SupportsAccesskeyAttribute SupportsAccesskeyAttribute SupportsAccesskeyAttribute SupportsAccesskeyAttribute
SupportsBodyColor SupportsBodyColor SupportsBodyColor SupportsBodyColor
SupportsBold SupportsBold SupportsBold SupportsBold
SupportsCacheControlMetaTag SupportsCacheControlMetaTag SupportsCacheControlMetaTag SupportsCacheControlMetaTag
SupportsCallback SupportsCallback SupportsCallback SupportsCallback

Gets a value indicating whether the browser supports callback scripts.

(Inherited from HttpCapabilitiesBase)
SupportsCss SupportsCss SupportsCss SupportsCss
SupportsDivAlign SupportsDivAlign SupportsDivAlign SupportsDivAlign
SupportsDivNoWrap SupportsDivNoWrap SupportsDivNoWrap SupportsDivNoWrap
SupportsEmptyStringInCookieValue SupportsEmptyStringInCookieValue SupportsEmptyStringInCookieValue SupportsEmptyStringInCookieValue
SupportsFontColor SupportsFontColor SupportsFontColor SupportsFontColor
SupportsFontName SupportsFontName SupportsFontName SupportsFontName
SupportsFontSize SupportsFontSize SupportsFontSize SupportsFontSize
SupportsImageSubmit SupportsImageSubmit SupportsImageSubmit SupportsImageSubmit
SupportsIModeSymbols SupportsIModeSymbols SupportsIModeSymbols SupportsIModeSymbols
SupportsInputIStyle SupportsInputIStyle SupportsInputIStyle SupportsInputIStyle
SupportsInputMode SupportsInputMode SupportsInputMode SupportsInputMode
SupportsItalic SupportsItalic SupportsItalic SupportsItalic
SupportsJPhoneMultiMediaAttributes SupportsJPhoneMultiMediaAttributes SupportsJPhoneMultiMediaAttributes SupportsJPhoneMultiMediaAttributes
SupportsJPhoneSymbols SupportsJPhoneSymbols SupportsJPhoneSymbols SupportsJPhoneSymbols
SupportsQueryStringInFormAction SupportsQueryStringInFormAction SupportsQueryStringInFormAction SupportsQueryStringInFormAction
SupportsRedirectWithCookie SupportsRedirectWithCookie SupportsRedirectWithCookie SupportsRedirectWithCookie
SupportsSelectMultiple SupportsSelectMultiple SupportsSelectMultiple SupportsSelectMultiple
SupportsUncheck SupportsUncheck SupportsUncheck SupportsUncheck
SupportsXmlHttp SupportsXmlHttp SupportsXmlHttp SupportsXmlHttp

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

(Inherited from HttpCapabilitiesBase)
Tables Tables Tables Tables

Gets a value indicating whether the client browser supports HTML tables.

(Inherited from HttpBrowserCapabilities)
TagWriter TagWriter TagWriter TagWriter

Used internally to get the type of the object that is used to write tags for the browser.

(Inherited from HttpBrowserCapabilities)
Type Type Type Type

Gets the name and major (that is, integer) version number of the client browser.

(Inherited from HttpBrowserCapabilities)
UseOptimizedCacheKey UseOptimizedCacheKey UseOptimizedCacheKey UseOptimizedCacheKey

Used internally to get a value indicating whether to use an optimized cache key.

(Inherited from HttpCapabilitiesBase)
VBScript VBScript VBScript VBScript

Gets a value indicating whether the client browser supports VBScript.

(Inherited from HttpBrowserCapabilities)
Version Version Version Version

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

(Inherited from HttpBrowserCapabilities)
W3CDomVersion W3CDomVersion W3CDomVersion W3CDomVersion

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

(Inherited from HttpBrowserCapabilities)
Win16 Win16 Win16 Win16

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

(Inherited from HttpBrowserCapabilities)
Win32 Win32 Win32 Win32

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

(Inherited from HttpBrowserCapabilities)

Methods

AddBrowser(String) AddBrowser(String) AddBrowser(String) AddBrowser(String)

Used internally to add an entry to the internal collection of browsers for which capabilities are recognized.

(Inherited from HttpCapabilitiesBase)
CreateHtmlTextWriter(TextWriter) CreateHtmlTextWriter(TextWriter) CreateHtmlTextWriter(TextWriter) CreateHtmlTextWriter(TextWriter)

Creates a new instance of the HtmlTextWriter to be used.

(Inherited from HttpCapabilitiesBase)
DisableOptimizedCacheKey() DisableOptimizedCacheKey() DisableOptimizedCacheKey() DisableOptimizedCacheKey()

Used internally to disable use of an optimized cache key.

(Inherited from HttpCapabilitiesBase)
Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetClrVersions() GetClrVersions() GetClrVersions() GetClrVersions()

Returns all versions of the .NET common language runtime (CLR) installed on the client.

(Inherited from HttpBrowserCapabilities)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
HasCapability(String, String) HasCapability(String, String) HasCapability(String, String) HasCapability(String, String)

Provides a uniform way to evaluate device capabilities. This method is used internally by ASP.NET to implement various device-selection criteria expressed in the syntax of the controls. For example, this method is used to choose among <Choice> Element (.NET Framework Developer's Guide) elements in a DeviceSpecific/Choice construct. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

Init() Init() Init() Init()

Used internally to initialize an internal set of values.

(Inherited from HttpCapabilitiesBase)
IsBrowser(String) IsBrowser(String) IsBrowser(String) IsBrowser(String)

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

(Inherited from HttpCapabilitiesBase)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

IFilterResolutionService.CompareFilters(String, String) IFilterResolutionService.CompareFilters(String, String) IFilterResolutionService.CompareFilters(String, String) IFilterResolutionService.CompareFilters(String, String)

Used internally to compare filters.

(Inherited from HttpCapabilitiesBase)
IFilterResolutionService.EvaluateFilter(String) IFilterResolutionService.EvaluateFilter(String) IFilterResolutionService.EvaluateFilter(String) IFilterResolutionService.EvaluateFilter(String)

Used internally to evaluate a filter.

(Inherited from HttpCapabilitiesBase)

Security

AspNetHostingPermission
for operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.

Applies to

See also