共用方式為


<mobileControls> 

Defines adapter sets that map ASP.NET mobile controls to corresponding adapters within the <system.web> section of the Web.config file.

<system.web>
  <mobileControls
    allowCustomAttributes="true|false"
    sessionStateHistorySize="historySize" 
    cookielessDataDictionaryType="System.Web.Mobile.CookielessData"|"">
    <device 
      name="name"
      inheritsFrom="parentAdapterSet"
      predicateClass="predicateClass"
      predicateMethod="predicateMethod"
      pageAdapter="pageAdapterClass"> 
      <control name="controlClass" adapter="adapterClass" />
      ... More controls here.
    </device>
  </mobileControls>
</system.web>

Remarks

The mobile controls configuration settings also provide general configuration settings for ASP.NET mobile Web pages. All mobile controls allow you to set custom control attributes using the IAttributeAccessor interface of ASP.NET Web pages. This interface provides the GetAttribute and SetAttribute methods. In addition, the MobileControl class exposes a CustomAttributes dictionary. For more information about custom attributes, see Custom Attributes for Mobile Controls. For more information about how to create and configure adapters, see Adding New Device Adapters and Device Support.

The attributes for the <mobileControls> element are defined in the following table.

Attribute Description

allowCustomAttributes

Specifies whether pages can have custom attributes.

sessionStateHistorySize

Specifies the size of the history to use to keep application view state in the server session. For more information, see Understanding State Management.

cookielessDataDictionaryType

Specifies a dictionary class to maintain the keys for cookieless forms authentication. To turn off this behavior, set the value to an empty string ("").

See Also

Reference

<device>

Concepts

Mobile Controls Reference

Other Resources

Configuration Files in the Mobile Controls