次の方法で共有


SPMobileUtility.AppendMobileQueryString method

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

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

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 when navigating from a computer forces a computer browser to open the mobile version of the page. Unlike previous versions of SharePoint, this setting is now sticky. After it is set it on one URL, every page from that site collection the user navigates to will be the mobile version until the behavior is turned off by the addition of "?Mobile=0" to the end of the URL for some page of the site collection.

Adding “?Mobile=0” to the URL when navigating from a mobile device forces a mobile device to attempt to open the nonmobile version of the page. This setting is sticky.

See also

Reference

SPMobileUtility class

SPMobileUtility members

Microsoft.SharePoint.Utilities namespace