LoadDataFromJson Method
- Namespace
TXTextControl.Web
- Package
- None: the TX Text Control .NET Server setup installs it, for .NET Framework.
- Assembly
TXTextControl.Web. 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 void LoadDataFromJson(string json);Public Sub LoadDataFromJson(json As String)Parameters
| Parameter | Description |
|---|---|
| json | The JSON string containing the merge data. |
Examples
LoadDataFromJson is not exposed by the current ASP.NET Core editor helper. The following example uses LoadDataFromJson in the current server-side setup instead.
var result = textControl.LoadDataFromJson("{\"CustomerName\":\"Contoso Ltd.\"}");
Console.WriteLine(result);Dim result = textControl.LoadDataFromJson("{""CustomerName"":""Contoso Ltd.""}")
Console.WriteLine(result)