SPWebPartManager.ReplaceTokens method

Gets a new string within which the tokens have been replaced by the appropriate values for a specified Web Part.

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

Syntax

'Declaration
Public Shared Function ReplaceTokens ( _
    context As HttpContext, _
    web As SPWeb, _
    webPart As WebPart, _
    input As String _
) As String
'Usage
Dim context As HttpContext
Dim web As SPWeb
Dim webPart As WebPart
Dim input As String
Dim returnValue As String

returnValue = SPWebPartManager.ReplaceTokens(context, _
    web, webPart, input)
public static string ReplaceTokens(
    HttpContext context,
    SPWeb web,
    WebPart webPart,
    string input
)

Parameters

  • input
    Type: System.String

    A string that requires token replacement.

Return value

Type: System.String
A new string within which the tokens have been replaced by the appropriate values.

Remarks

This method combs the input string to look for tokens and replaces them with the appropriate values based on the context, web, and webPart parameters.

See also

Reference

SPWebPartManager class

SPWebPartManager members

Microsoft.SharePoint.WebPartPages namespace