Click or drag to resize
ControlsHelper.ResolveMacros Method (String, DataRow, Boolean)
Replaces macros in text with appropriate value of the datarow and returns the result.

Namespace: CMS.Base.Web.UI
Assembly: CMS.Base.Web.UI (in CMS.Base.Web.UI.dll) Version: 11.0.0
Syntax
C#
public static string ResolveMacros(
	string sourceText,
	DataRow dr,
	bool encode = false
)

Parameters

sourceText
Type: System.String
Source text to be processed
dr
Type: System.Data.DataRow
DataRow containing data that will be used for replacements
encode (Optional)
Type: System.Boolean
Indicates whether macro should be encoded

Return Value

Type: String
Remarks
It also escapes apostrophes ("'") to "\'" so that they do not break JavaScript.
See Also