mobileControls 項目 (ASP.NET 設定結構描述)
更新:2007 年 11 月
定義能將 ASP.NET Mobile 控制項對應到 Web.config 組態檔 system.web 項目 (ASP.NET 設定結構描述) 區段中對應配置器的配置器集合。
configuration 項目 (一般設定結構描述)
system.web 項目 (ASP.NET 設定結構描述)
mobileControls 項目 (ASP.NET 設定結構描述)
<mobileControls allowCustomAttributes="true|false" cookielessDataDictionaryType="System.Web.Mobile.CookielessData" sessionStateHistorySize="number"> <device...>...</device> </mobileControls>
屬性和項目
下列章節會說明屬性 (Attribute)、子項目和父項目。
屬性
屬性 |
描述 |
---|---|
allowCustomAttributes |
選擇性的 Boolean 屬性。 指定行動控制項是否可以有自訂屬性。 預設值為 false。 |
cookielessDataDictionaryType |
選擇性的 Type 屬性。 定義維護 Cookieless 表單驗證關鍵字之字典類別的類型。若要關閉這個行為,請將此值設定為空字串 ("")。 預設值是 CookielessData。 |
sessionStateHistorySize |
選擇性的 Int32 屬性。 定義在伺服器工作階段 (Session) 中用於保存應用程式檢視狀態的記錄大小。 預設值為 6。 |
子項目
項目 |
描述 |
---|---|
device |
定義將 ASP.NET Mobile 控制項對應至 web.config 組態檔之 <system.web> 和 <mobileControls> 區段中對應配置器的新配置器集合。 |
父項目
項目 |
描述 |
---|---|
configuration |
Common Language Runtime 和 .NET Framework 應用程式所使用之每個組態檔中的必要根項目。 |
system.web |
針對組態檔中的 ASP.NET 組態設定指定根項目。包含設定 ASP.NET Web 應用程式和控制該應用程式之行為方式的項目。 |
備註
行動控制項組態設定也提供 ASP.NET Mobile Web Form 頁面的一般組態設定。所有行動控制項允許開發人員使用 .NET Framework 的 IAttributeAccessor 介面設定自訂控制項屬性。這個介面提供 GetAttribute 和 SetAttribute 方法;此外,MobileControl 類別可公開 (Expose) 名為 CustomAttributes 的字典。如需自訂屬性的詳細資訊,請參閱行動控制項的自訂屬性文件。
如需如何建立和設定配置器的詳細資訊,請參閱加入新裝置配接器和裝置支援文件中的章節。
預設的組態
下列預設 <mobileControls> 項目是在 .NET Framework 2.0 版中的根 Web.config 檔中設定。
<mobileControls sessionStateHistorySize="6"
cookielessDataDictionaryType="System.Web.Mobile.CookielessData">
<device name="XhtmlDeviceAdapters"
predicateClass="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPageAdapter"
predicateMethod="DeviceQualifies"
pageAdapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPageAdapter">
<control name="System.Web.UI.MobileControls.Panel"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPanelAdapter" />
<control name="System.Web.UI.MobileControls.Form"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlFormAdapter" />
<control name="System.Web.UI.MobileControls.TextBox"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlTextBoxAdapter" />
<control name="System.Web.UI.MobileControls.Label"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlLabelAdapter" />
<control name="System.Web.UI.MobileControls.LiteralText"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlLiteralTextAdapter" />
<control name="System.Web.UI.MobileControls.Link"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlLinkAdapter" />
<control name="System.Web.UI.MobileControls.Command"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlCommandAdapter" />
<control name="System.Web.UI.MobileControls.PhoneCall"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlPhoneCallAdapter" />
<control name="System.Web.UI.MobileControls.List"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlListAdapter" />
<control name="System.Web.UI.MobileControls.SelectionList"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlSelectionListAdapter" />
<control name="System.Web.UI.MobileControls.ObjectList"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlObjectListAdapter" />
<control name="System.Web.UI.MobileControls.Image"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlImageAdapter" />
<control name="System.Web.UI.MobileControls.ValidationSummary"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlValidationSummaryAdapter" />
<control name="System.Web.UI.MobileControls.Calendar"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlCalendarAdapter" />
<control name="System.Web.UI.MobileControls.TextView"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlTextViewAdapter" />
<control name="System.Web.UI.MobileControls.MobileControl"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlControlAdapter" />
<control name="System.Web.UI.MobileControls.BaseValidator"
adapter="System.Web.UI.MobileControls.Adapters.XhtmlAdapters.XhtmlValidatorAdapter" />
</device>
<device name="HtmlDeviceAdapters"
predicateClass="System.Web.UI.MobileControls.Adapters.HtmlPageAdapter"
predicateMethod="DeviceQualifies"
pageAdapter="System.Web.UI.MobileControls.Adapters.HtmlPageAdapter">
<control name="System.Web.UI.MobileControls.Panel"
adapter="System.Web.UI.MobileControls.Adapters.HtmlPanelAdapter" />
<control name="System.Web.UI.MobileControls.Form"
adapter="System.Web.UI.MobileControls.Adapters.HtmlFormAdapter" />
<control name="System.Web.UI.MobileControls.TextBox"
adapter="System.Web.UI.MobileControls.Adapters.HtmlTextBoxAdapter" />
<control name="System.Web.UI.MobileControls.Label"
adapter="System.Web.UI.MobileControls.Adapters.HtmlLabelAdapter" />
<control name="System.Web.UI.MobileControls.LiteralText"
adapter="System.Web.UI.MobileControls.Adapters.HtmlLiteralTextAdapter" />
<control name="System.Web.UI.MobileControls.Link"
adapter="System.Web.UI.MobileControls.Adapters.HtmlLinkAdapter" />
<control name="System.Web.UI.MobileControls.Command"
adapter="System.Web.UI.MobileControls.Adapters.HtmlCommandAdapter" />
<control name="System.Web.UI.MobileControls.PhoneCall"
adapter="System.Web.UI.MobileControls.Adapters.HtmlPhoneCallAdapter" />
<control name="System.Web.UI.MobileControls.List"
adapter="System.Web.UI.MobileControls.Adapters.HtmlListAdapter" />
<control name="System.Web.UI.MobileControls.SelectionList"
adapter="System.Web.UI.MobileControls.Adapters.HtmlSelectionListAdapter" />
<control name="System.Web.UI.MobileControls.ObjectList"
adapter="System.Web.UI.MobileControls.Adapters.HtmlObjectListAdapter" />
<control name="System.Web.UI.MobileControls.Image"
adapter="System.Web.UI.MobileControls.Adapters.HtmlImageAdapter" />
<control name="System.Web.UI.MobileControls.BaseValidator"
adapter="System.Web.UI.MobileControls.Adapters.HtmlValidatorAdapter" />
<control name="System.Web.UI.MobileControls.ValidationSummary"
adapter="System.Web.UI.MobileControls.Adapters.HtmlValidationSummaryAdapter" />
<control name="System.Web.UI.MobileControls.Calendar"
adapter="System.Web.UI.MobileControls.Adapters.HtmlCalendarAdapter" />
<control name="System.Web.UI.MobileControls.TextView"
adapter="System.Web.UI.MobileControls.Adapters.HtmlTextViewAdapter" />
<control name="System.Web.UI.MobileControls.MobileControl"
adapter="System.Web.UI.MobileControls.Adapters.HtmlControlAdapter" />
</device>
<device name="UpWmlDeviceAdapters"
inheritsFrom="WmlDeviceAdapters"
predicateClass="System.Web.UI.MobileControls.Adapters.UpWmlPageAdapter"
predicateMethod="DeviceQualifies"
pageAdapter="System.Web.UI.MobileControls.Adapters.UpWmlPageAdapter">
</device>
<device name="WmlDeviceAdapters"
predicateClass="System.Web.UI.MobileControls.Adapters.WmlPageAdapter"
predicateMethod="DeviceQualifies"
pageAdapter="System.Web.UI.MobileControls.Adapters.WmlPageAdapter">
<control name="System.Web.UI.MobileControls.Panel"
adapter="System.Web.UI.MobileControls.Adapters.WmlPanelAdapter" />
<control name="System.Web.UI.MobileControls.Form"
adapter="System.Web.UI.MobileControls.Adapters.WmlFormAdapter" />
<control name="System.Web.UI.MobileControls.TextBox"
adapter="System.Web.UI.MobileControls.Adapters.WmlTextBoxAdapter" />
<control name="System.Web.UI.MobileControls.Label"
adapter="System.Web.UI.MobileControls.Adapters.WmlLabelAdapter" />
<control name="System.Web.UI.MobileControls.LiteralText"
adapter="System.Web.UI.MobileControls.Adapters.WmlLiteralTextAdapter" />
<control name="System.Web.UI.MobileControls.Link"
adapter="System.Web.UI.MobileControls.Adapters.WmlLinkAdapter" />
<control name="System.Web.UI.MobileControls.Command"
adapter="System.Web.UI.MobileControls.Adapters.WmlCommandAdapter" />
<control name="System.Web.UI.MobileControls.PhoneCall"
adapter="System.Web.UI.MobileControls.Adapters.WmlPhoneCallAdapter" />
<control name="System.Web.UI.MobileControls.List"
adapter="System.Web.UI.MobileControls.Adapters.WmlListAdapter" />
<control name="System.Web.UI.MobileControls.SelectionList"
adapter="System.Web.UI.MobileControls.Adapters.WmlSelectionListAdapter" />
<control name="System.Web.UI.MobileControls.ObjectList"
adapter="System.Web.UI.MobileControls.Adapters.WmlObjectListAdapter" />
<control name="System.Web.UI.MobileControls.Image"
adapter="System.Web.UI.MobileControls.Adapters.WmlImageAdapter" />
<control name="System.Web.UI.MobileControls.BaseValidator"
adapter="System.Web.UI.MobileControls.Adapters.WmlValidatorAdapter" />
<control name="System.Web.UI.MobileControls.ValidationSummary"
adapter="System.Web.UI.MobileControls.Adapters.WmlValidationSummaryAdapter" />
<control name="System.Web.UI.MobileControls.Calendar"
adapter="System.Web.UI.MobileControls.Adapters.WmlCalendarAdapter" />
<control name="System.Web.UI.MobileControls.TextView"
adapter="System.Web.UI.MobileControls.Adapters.WmlTextViewAdapter" />
<control name="System.Web.UI.MobileControls.MobileControl"
adapter="System.Web.UI.MobileControls.Adapters.WmlControlAdapter" />
</device>
<device name="ChtmlDeviceAdapters"
inheritsFrom="HtmlDeviceAdapters"
predicateClass="System.Web.UI.MobileControls.Adapters.ChtmlPageAdapter"
predicateMethod="DeviceQualifies"
pageAdapter="System.Web.UI.MobileControls.Adapters.ChtmlPageAdapter">
<control name="System.Web.UI.MobileControls.Form"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlFormAdapter" />
<control name="System.Web.UI.MobileControls.Calendar"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlCalendarAdapter" />
<control name="System.Web.UI.MobileControls.Image"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlImageAdapter" />
<control name="System.Web.UI.MobileControls.TextBox"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlTextBoxAdapter" />
<control name="System.Web.UI.MobileControls.SelectionList"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlSelectionListAdapter" />
<control name="System.Web.UI.MobileControls.Command"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlCommandAdapter" />
<control name="System.Web.UI.MobileControls.PhoneCall"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlPhoneCallAdapter" />
<control name="System.Web.UI.MobileControls.Link"
adapter="System.Web.UI.MobileControls.Adapters.ChtmlLinkAdapter" />
</device>
</mobileControls>
範例
下列範例將說明繼承自 Form 類別的控制項,並提供在指定的時間間隔後,引發事件或執行其他動作的能力。
<mobileControls>
<device name="PortalHtmlDeviceAdapters" inheritsFrom="HtmlDeviceAdapters">
<control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.HtmlTabbedPanelAdapter,Portal" />
<control name="ASPNetPortal.MobileControls.LinkCommand, Portal" adapter="ASPNetPortal.MobileControls.HtmlLinkCommandAdapter,Portal" />
</device>
<device name="PortalChtmlDeviceAdapters" inheritsFrom="ChtmlDeviceAdapters">
<control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.ChtmlTabbedPanelAdapter,Portal" />
</device>
<device name="PortalWmlDeviceAdapters" inheritsFrom="WmlDeviceAdapters">
<control name="ASPNetPortal.MobileControls.TabbedPanel, Portal" adapter="ASPNetPortal.MobileControls.WmlTabbedPanelAdapter,Portal" />
</device>
</mobileControls>
項目資訊
Configuration Section Handler |
|
Configuration Member |
|
Configurable Locations |
Machine.config 根層次 Web.config 應用程式層級 Web.config 虛擬或實體目錄層級 Web.config |
Requirements |
IIS 5.0、IIS 5.1 或 IIS 6.0 .NET Framework 1.1 或 2.0 Visual Studio .NET 2003 或 Visual Studio 2005 |
請參閱
工作
概念
參考
system.web 項目 (ASP.NET 設定結構描述)
mobileControls 的 device 項目 (ASP.NET 設定結構描述)
deviceFilters 項目 (ASP.NET 設定結構描述)