Microsoft KB Archive/309462

= PRB: &quot;Entity Too Large&quot; Error Message When You Send Data to a Mobile Device =

Article ID: 309462

Article Last Modified on 6/14/2002

-

APPLIES TO


 * Microsoft Mobile Internet Toolkit 1.0

-



This article was previously published under Q309462



SYMPTOMS
Mobile Web Forms controls provide a mechanism for automatically displaying large groups of content in smaller &quot;pages.&quot; This functionality is called pagination. When you send large amounts of data to a mobile device, it is recommended that you enable pagination on a form by setting Paginate=true on the mobile:Form tag.

Some devices do not contain enough memory to display large amounts of data, and as a result, you may receive an error message when pagination is not enabled on a mobile Web Form.

Specifically, you may receive the following error message when you use the Nokia WAP Toolkit 2.1:

Http Error - Entity Too Large

And you may receive the following error message when you use the Nokia Mobile Internet Toolkit 3.0:

Requested entity too large

Some devices or emulators may not generate an error message, but instead become slow to respond when you scroll the large list that is returned. Other devices may not be able to function until they are reset.



CAUSE
This behavior can occur if pagination is not enabled.



RESOLUTION
To resolve this issue, enable pagination.

The pagination feature is based on a weighting system. Each control on a mobile Web Form is assigned a unit value. The unit value of all the controls on the page is compared against the OptimumPageWeight property to determine where to divide the page to prevent memory errors. You can configure the OptimumPageWeight property to increase or decrease the weight that a device can support. Configure the OptimumPageWeight property in the section of the Machine.Config file that is used to identify mobile devices.



MORE INFORMATION
The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Steps to Reproduce the Problem
The following steps demonstrate this issue by using the Nokia Mobile Internet Toolkit 3.0 and by sending a large list of data to the emulator. These steps presume that Microsoft Visual Studio .NET, Microsoft Mobile Internet Toolkit, and Nokia Mobile Internet Toolkit 3.0 are installed on your computer.  Start Visual Studio .NET, and then create a new C# mobile Web application named &quot;Pagination.&quot; From the Toolbox, drag and drop a single List control to the mobile Web Form that is created by default. Leave the name of the list as &quot;List1.&quot; Right-click the MobileWebForm1.aspx file in the Solution Explorer, and then click View Code.  Add the following code to the Page_Load function: for(int x = 1; x < 3000; x++) { List1.Items.Add(&quot;Item &quot; + x.ToString); }                    Save and build the project. View the mobile Web page in a mobile Web browser.

If the device does not have enough memory, you may receive an error message.</li>  To resolve these types of error messages, you need to add the Paginate attribute to the mobile:form tag in your .aspx page, as follows: <mobile:Form id=&quot;Form1&quot; runat=&quot;server&quot; Paginate=&quot;True&quot;> </li> View the page again in the mobile device.

Note that you no longer receive an error message, and the data is available on multiple pages.</li></ol>

Keywords: kberrmsg kbwmldevice kbwebforms kbdevicespecific kbprb kbservercontrols kbchtmldevice KB309462

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.