Thanks for your reply Alex,
For the "DeviceSpecifc" template, I've mentioned your another thread
"Mobile Repeater..." as I've provided some reference on how to configure
and define mobile device specific filter there. Anyway, I'll repaste them
here and add some further description here.
Actually, for "DeviceSpecific", it can be defined once in each ASP.NET
mobile control(mobile:Form or other control that support such a template).
And in each "DeviceSpecific" template, you can add multiple "<Choice>" and
"choice" is based on a filter, this is configurable in the web.config file.
e.g.
==========
<deviceFilters>
<filter name="IsIE" type="ClassLibrary1.MobileFilterClass,
ClassLibrary1" method="IsIE" />
<filter name="IsNotIE" type="ClassLibrary1.MobileFilterClass,
ClassLibrary1" method="IsNotIE" />
<!-- built-in ones-->
<filter name="isJPhone" compare="Type" argument="J-Phone" />
<filter name="isHTML32" compare="PreferredRenderingType"
argument="html32" />
<filter name="isWML11" compare="PreferredRenderingType"
argument="wml11" />
<filter name="isCHTML10" compare="PreferredRenderingType"
argument="chtml10" />
<filter name="isGoAmerica" compare="Browser" argument="Go.Web"
/>
<filter name="isMME" compare="Browser" argument="Microsoft
Mobile Explorer" />
<filter name="isMyPalm" compare="Browser" argument="MyPalm" />
<filter name="isPocketIE" compare="Browser" argument="Pocket
IE" />
<filter name="isUP3x" compare="Type" argument="Phone.com 3.x
Browser" />
............
=====================
In the "built-in ones" are added when you create a mobile web.config file.
And the "IsIE" and "IsNotIE" ones are added by myself. I use a custom class
to supply the filter's detection logic, the code of the class is quite
simple(just for test):
=========
public class MobileFilterClass
{
public static bool IsIE(System.Web.Mobile.MobileCapabilities
capabilities,
String compareArgument)
{
return true;
}
public static bool IsNotIE(System.Web.Mobile.MobileCapabilities
capabilities,
String compareArgument)
{
return false;
}
}
===============
and I can then use it in my mobile page(make sure to add the reference of
the custom class's assembly in the application):
=======mobile aspx page=======
<mobile:Form id="Form1" runat="server">
<mobile
eviceSpecific ID="dshtml" Runat="server">
<Choice Filter="IsIE" >
<HeaderTemplate>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
<hr />
..............
================
as the document mentioned, you can use both class or mobile capability
properties to define filter:
#<deviceFilters>
http://msdn2.microsoft.com/en-us/library/k25f323z.aspx
#filter Element for deviceFilters (ASP.NET Settings Schema)
http://msdn2.microsoft.com/en-us/library/ms228320.aspx
In addition, here are some other MSDN reference helpful to you:
#Using Device Filters
https://msdn2.microsoft.com/en-us/library/d7k7a6z2.aspx
#<Choice> Element (.NET Framework Developer's Guide )
http://msdn2.microsoft.com/en-us/library/3tfbhf6f.aspx
#Device-Specific Content
http://dotnetjunkies.com/MobileQuickStart/(klvbrkyhamv2i5yfzqwhhxnr)/Default
..aspx?url=doc/DeviceSpecific.aspx
Hope this helps a little further on this. If you have any more specific
questions, welcome to post here.
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.