SPMobileUtility.AppendMobileQueryString Method

Returns the URL with either “?Mobile=1” or “?Mobile=o” appended to the end.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public Shared Function AppendMobileQueryString ( _
    url As String, _
    redirectToMobilePage As Boolean _
) As String
'Usage
Dim url As String
Dim redirectToMobilePage As Boolean
Dim returnValue As String

returnValue = SPMobileUtility.AppendMobileQueryString(url, _
    redirectToMobilePage)
public static string AppendMobileQueryString(
    string url,
    bool redirectToMobilePage
)

Parameters

  • redirectToMobilePage
    Type: System.Boolean

    true to append “?Mobile=1”, false to append “?Mobile=0”

Return Value

Type: System.String
The original URL with the mobile query appended to the end.

Remarks

Adding “?Mobile=1” to the end of a nonmobile page URL forces a computer browser to open the mobile version of the page. Adding “?Mobile=0” to the URL forces a mobile device to attempt to open the nonmobile version of the page.

See Also

Reference

SPMobileUtility Class

SPMobileUtility Members

Microsoft.SharePoint.Utilities Namespace