更新:2007 年 11 月
定义适配器集,以将 ASP.NET 移动控件映射到 Web.config 文件的 <system.web> 节中的相应适配器。
<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>
备注
移动控件配置设置还为 ASP.NET 移动网页提供了常规配置设置。所有移动控件通过使用 ASP.NET 网页的 IAttributeAccessor 接口允许您设置自定义控件属性。此接口提供 GetAttribute 和 SetAttribute 方法。此外,MobileControl 类公开 CustomAttributes 字典。有关自定义属性的更多信息,请参见移动控件的自定义属性。有关如何创建和配置适配器的更多信息,请参见添加新的设备适配器和设备支持。
下表对 <mobileControls> 元素的属性进行了详细说明。
属性 |
说明 |
---|---|
allowCustomAttributes |
指定页是否可以具有自定义属性。 |
sessionStateHistorySize |
指定用于在服务器会话中保存应用程序视图状态的历史记录的大小。有关更多信息,请参见了解状态管理。 |
cookielessDataDictionaryType |
指定一个字典类以维护没有 Cookie 的 Forms 身份验证的密钥。若要禁用此行为,请将该值设置为空字符串 ("")。 |