Working With Deck Size Limits

When a WML-based cell phone requests a Web page, the WML deck returned by the server is compiled by the WAP gateway into a compact representation of the Web page. The browser then receives this compiled version of the deck.

Most WML-based browsers have a limitation on the size of a compiled deck that they can receive. This is known as the deck size limit, and can vary according to the individual device. Because the limit applies to content compiled at the gateway, it is difficult to determine whether a WML deck is too large for a device. This is particularly true for dynamic, data-bound pages, because the change in size due to compilation depends on the exact content of the WML deck.

ASP.NET does not limit or truncate pages to make decks fit within the deck size limit of individual devices. As a general guideline, you must design pages so that the rendered WML output is approximately 1,200 characters. By doing so, you can usually avoid decks that are too large because of variations in dynamic content.

To determine whether a page is safe

  1. If controls on the page are data-bound, bind the data to a typical set of data.
  2. Test the page on an emulator.
  3. Determine the size of the rendered output, either by using information provided by the emulator, or by using ASP.NET application tracing.

To reduce the rendered size of a page

  • Use property overrides to specify abbreviated text for labels, lists, and other controls.
  • Enable form pagination by setting the Paginate property to true.
  • Break a single form into a series of forms.
  • Use a Panel control with a ContentTemplate to provide separate content for other devices.
  • If using a List or a similar control, reduce the number of items on each page by setting the ItemsPerPage property. You can use a property override to make the value specific to one or more WML-based devices.

If the dynamic content for a page can vary significantly, you can repeat the previous steps for testing page sizes with different amounts of data and compare the sizes to determine how to reduce the page size.

The MaximumRenderedPageSize property of the MobileCapabilities class provides the maximum deck size of the target device. By using this value with property overrides, you can further customize the content of an application to suit specific devices. For example, if the maximum deck size of a device is more than 2,000 bytes, you can adjust your page content based on a guideline of 1,500 characters instead of 1,200.

See Also

Device Template Support | Linking Between ASP.NET Mobile Web Forms | Pagination Support | Developing ASP.NET Mobile Web Applications | Application Developer's Guide