Property
|
Description
|
|---|
Filter |
Specifies the device filter to evaluate. If this property is omitted, the choice is selected by default.
|
Contents |
Returns the overridden properties defined for a choice. Changing this collection after overridden properties have been processed (in OnDeviceCustomize will have no effect.
|
HasTemplates |
Returns true if the <Choice> element has any templates defined; otherwise, returns false.
|
Templates |
Returns the template set defined for a <Choice> element.
|
Xmlns |
Used by the designer to determine the type of markup inside templates of a <Choice> element. Not intended for general developer use.
|
The filter name must be the name of a method on the page or in the associated .ascx file, or the name of a valid device filter defined in the <deviceFilters> section of the Web.config file. If a method name is specified with the Filter property, that method must have the following signature:
|
public bool methodName(
System.Web.Mobile.MobileCapabilities capabilities,
String optionalArgument) |
For example, if the Filter property is set to myChoiceMethod, a method with the following signature must exist:
|
public bool myChoiceMethod(
System.Web.Mobile.MobileCapabilities capabilities,
String optionalArgument) |
When evaluating the <Choice> element, a check is made to determine whether a method of the appropriate signature exists on the page. If not, the <deviceFilters> section of the Web.config file is checked.
For more information about device filter evaluation, see Device-Specific Rendering and the documentation for the Filter property.
Description
For a detailed example, see the Filter property.
Code
|
<DeviceSpecific>
<Choice Filter = "isHTML32">
<HeaderTemplate>
<mobile:Image runat=server ImageUrl="defaul1.gif" />
</HeaderTemplate>
</Choice>
<Choice Filter="prefersWBMP">
<HeaderTemplate>
<mobile:Image runat="server" ImageUrl="default1.wbmp" />
Wbmp Image<br />
</HeaderTemplate>
</Choice>
</DeviceSpecific> |