Hi John,
Thank you for your update. You may change "IsColor" to "isColor". Does it
work?
Hope this helps.
Best regards,
Lewis
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Content-Class: urn:content-classes:message
| From: "John Miller" <
[email protected]>
| Sender: "John Miller" <
[email protected]>
| References: <
[email protected]>
<
[email protected]>
| Subject: RE: Device Filters
| Date: Thu, 11 Sep 2003 10:50:13 -0700
| Lines: 135
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Thread-Index: AcN4jSb62UYwbVyzT8y9Y2kmNsCcRg==
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Newsgroups: microsoft.public.dotnet.framework.aspnet.mobile
| Path: cpmsftngxa06.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet.mobile:6229
| NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.mobile
|
|
| Hi Lewis,
|
| I added the method and it solved the problem. Thanks for
| the help.
|
| The Choice Element help topic states that "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
| web.config is checked."
|
| It seems as if this check isn't being made and the page
| errors out before the web.config is checked.
|
| What do I need to do to be able to define the filters in
| the web.config.
|
| jMM
|
|
| >-----Original Message-----
| >Hi John,
| >
| >You may define public methods for the filters. For
| example:
| >
| >public bool IsHTML(System.Web.Mobile.MobileCapabilities
| capabilities,
| >String optionalArgument)
| >{
| > return true;
| >}
| >
| >When a device requests the page, the framework checks
| each defined <Choice>
| >tag in order. For each choice, it tests the filter
| specified by the filter
| >attribute. If the filter return true, that choice is
| picked.
| >
| >Please check the following link for more information.
| ><Choice> Element
| >
http://msdn.microsoft.com/library/default.asp?
| url=/library/en-us/mwsdk/html/
| >mwlrfchoiceelement.asp
| >
| >Hope this helps.
| >
| >Best regards,
| >Lewis
| >This posting is provided "AS IS" with no warranties, and
| confers no rights.
| >
| >--------------------
| >| Content-Class: urn:content-classes:message
| >| From: "John Miller" <
[email protected]>
| >| Sender: "John Miller" <
[email protected]>
| >| Subject: Device Filters
| >| Date: Wed, 10 Sep 2003 10:19:19 -0700
| >| Lines: 44
| >| Message-ID: <
[email protected]>
| >| MIME-Version: 1.0
| >| Content-Type: text/plain;
| >| charset="iso-8859-1"
| >| Content-Transfer-Encoding: 7bit
| >| X-Newsreader: Microsoft CDO for Windows 2000
| >| X-MimeOLE: Produced By Microsoft MimeOLE
| V5.50.4910.0300
| >| Thread-Index: AcN3v6tqbxfRfNgfSV6tYQeagQ30zQ==
| >| Newsgroups:
| microsoft.public.dotnet.framework.aspnet.mobile
| >| Path: cpmsftngxa06.phx.gbl
| >| Xref: cpmsftngxa06.phx.gbl
| >microsoft.public.dotnet.framework.aspnet.mobile:6215
| >| NNTP-Posting-Host: TK2MSFTNGXA14 10.40.1.166
| >| X-Tomcat-NG:
| microsoft.public.dotnet.framework.aspnet.mobile
| >|
| >|
| >| I'm working with the Device-Specific Content
| quickstart
| >| tutorials at
| >|
http://samples.gotdotnet.com/MobileQuickStart/
| >| (nh3mssfx2ihebm551zmqjxff)/Default.aspx?
| >| url=doc/DeviceSpecific.aspx
| >|
| >| I've added the device filters to system.web element in
| >| the web.config:
| >|
| >| <system.web>
| >| <deviceFilters>
| >| <filter name="IsColor" compare="IsColor"
| >| argument="true" />
| >| <filter name="IsPocketIE" compare="Browser"
| >| argument="Pocket IE" />
| >| <filter name="IsHTML"
| compare="PreferredRenderingMIME"
| >| argument="text/html" />
| >| </deviceFilters>
| >| </system.web>
| >|
| >| and I've added device specific elements to an aspx
| page:
| >|
| >| <mobile:Label runat="server" >
| >| <DeviceSpecific>
| >| <Choice Filter="IsPocketIE" Text="Running on
| Pocket
| >| IE" />
| >| <Choice Filter="IsHTML" Text="Running on other
| HTML
| >| device" />
| >| <Choice Text="Running on other device" />
| >| </DeviceSpecific>
| >| <mobile:Label>
| >|
| >| When I build and run I get the error:
| >|
| >| Can find neither a device capability named 'IsHTML32'
| nor
| >| a public non-static method on the page
| named 'IsHTML32'
| >| that returns a System.Boolean and takes
| >| System.Web.Mobile.MobileCapabilities and System.String
| as
| >| arguments.
| >|
| >| What am I missing?
| >|
| >| jMM
| >|
| >
| >.
| >
|