PRB: Errors Are Generated When You Use Redirects in Mobile Web Forms Pages (310481)



The information in this article applies to:

  • Microsoft Mobile Internet Toolkit (MMIT)

This article was previously published under Q310481

SYMPTOMS

When you use the Response.Redirect method in a mobile Web Forms page, you may receive the following error message:
Calling Response.Redirect on a postback can have unpredictable results on mobile devices and gateways. Use MobilePage.RedirectToMobilePage method instead.
When you are browsing to or compiling a page that contains the MobilePage.RedirectToMobilePage method, you may receive the following error message:
CS0120: An object reference is required for the nonstatic field, method, or property 'System.Web.UI.MobileControls.MobilePage.RedirectToMobilePage(string)'

RESOLUTION

To resolve this issue, use the following syntax:

Microsoft Visual Basic .NET
Me.RedirectToMobilePage(url)
				
Microsoft C# .NET
this.RedirectToMobilePage(url);
				

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:6/14/2002
Keywords:kbDSupport kbNavigation kbprb KB310481