PRB: Internal Server Error (500) Occurs upon Postback (310904)



The information in this article applies to:

  • Microsoft Mobile Internet Toolkit (MMIT)

This article was previously published under Q310904

SYMPTOMS

When browsing a mobile Web Form page with the OmniSky browser on a Palm Vx, you may receive the following error message:
Internal Server Error (500)

CAUSE

This behavior occurs because the OmniSky browser on the Palm Vx does not support cookies. When the page is posted back to the server, the mobile runtime is expecting a cookie that contains the session ID. This session ID is used to identify a unique session on the Web server that contains the ViewState information. Because cookies are not available, data that is maintained in ViewState is lost and is not available upon post back.

RESOLUTION

To resolve this behavior, enable cookieless sessions in your mobile Web application. Cookieless sessions store the session ID in the URL of the page. When the page is posted back to the server, the mobile runtime can identify the unique session on the server.

To enable cookieless sessions, modify the Web.config file in your Web application. Within the Web.config file, set the cookieless attribute of the <sessionState> element to true:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.web>
    <sessionState cookieless="true" />
   </system.web>
</configuration>
				

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Add a new mobile Web Form to a mobile Web application in Visual Studio .NET.
  2. Drag a Label control from the Mobile Web Forms section of the toolbox and drop it onto the mobile Web Form.
  3. Drag a Command control from the Mobile Web Forms section of the toolbox and drop it onto the mobile Web Form.
  4. On the View menu, click Code.
  5. Add the following code to the Page_Load event:
       // C# Code Sample
       Label1.Text = "Hello World";
    					
       ' VB Code Sample
       Label1.Text = "Hello World"
    					
  6. Build the solution, and then view the page on the Palm Vx with the OmniSky browser. Click the Command button to perform a postback.
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.

Modification Type:MajorLast Reviewed:6/14/2002
Keywords:kbCookie kbDeviceSpecific kbDSupport kbHTMLDevice kbprb kbState KB310904