SPMobileUtility.IsMobilePageRequest method
Returns a value that indicates whether the mobile version of the request page should be returned.
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Shared Function IsMobilePageRequest ( _
context As HttpContext, _
capabilities As HttpCapabilitiesBase _
) As Boolean
'Usage
Dim context As HttpContext
Dim capabilities As HttpCapabilitiesBase
Dim returnValue As Boolean
returnValue = SPMobileUtility.IsMobilePageRequest(context, _
capabilities)
public static bool IsMobilePageRequest(
HttpContext context,
HttpCapabilitiesBase capabilities
)
Parameters
context
Type: System.Web.HttpContextInformation about the request context.
capabilities
Type: System.Web.Configuration.HttpCapabilitiesBaseInformation about the capabilities of a device.
Return value
Type: System.Boolean
true if the mobile version of the page should be returned; otherwise, false.
Remarks
If automatic redirection is enabled, requests from mobile devices get the mobile version of the page unless ?mobile=0 or ?mbypass=1has been appended to the URL. ?mbypass=1 applies to just the request on which it is used; but ?mobile=0 is a sticky setting that will cause the mobile device to get the nonmoble versions of all pages in the site collection until it is turned off by adding ?mobile=1 to the URL of some page in the site collection.
A request from a nonmobile browser gets the mobile version if ?mobile=1 has been appended to the URL. Again, this is sticky until turned off by the addition of ?mobile=0 to the URL of some page in the site collection.