LoadDataFromJson Method
- Namespace
TXTextControl.Web. MVC
- Package
TXTextControl.asWeb TXTextControl.from nuget.org, the private NuGet feed or Text Control Offline PackagesWeb. DocumentEditor. dll
Description
Uses data given as a JSON string as a data source. The JSON string has to contain an array of equally structured objects. Analyzes and uses the given objects as merge data in the same way as the method LoadDataFromModel.
Syntax
public TextControl LoadDataFromJson(string json);Public Function LoadDataFromJson(json As String) As TextControlParameters
| Parameter | Description |
|---|---|
| json | The JSON string containing the merge data. |
Return Value
A reference to the Web.MVC.TextControl instance to allow method chaining.
Examples
The following example uses TextControl.LoadDataFromJson in a document-processing workflow.
var result = textControl.LoadDataFromJson("{\"CustomerName\":\"Contoso Ltd.\"}");
Console.WriteLine(result);Dim result = textControl.LoadDataFromJson("{""CustomerName"":""Contoso Ltd.""}")
Console.WriteLine(result)