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)
Available in Sandboxed Solutions: No
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
context
Type: System.Web.HttpContextThe current HTTP context.
web
Type: Microsoft.SharePoint.SPWebThe current website.
webPart
Type: System.Web.UI.WebControls.WebParts.WebPartThe Web Part associated with the input string.
input
Type: System.StringA 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.