# TextControl.LoadDataFromJson Method

> 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.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 24.0
- **Namespace:** `TXTextControl.Web.MVC`
- **Package:** `TXTextControl.Web` (assembly `TXTextControl.Web.DocumentEditor.dll`, from nuget.org, the private NuGet feed or Text Control Offline Packages)
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web.MVC > TextControl.LoadDataFromJson Method
- **399 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrol/loaddatafromjson-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrol/loaddatafromjson-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrol/loaddatafromjson-method/llms-full.txt

---

### 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](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrol/loaddatafrommodel-method/llms-full.txt).

### Syntax

```csharp
public TextControl LoadDataFromJson(string json);
```

```vbnet
Public Function LoadDataFromJson(json As String) As TextControl
```

### Parameters

| 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.

```csharp
var result = textControl.LoadDataFromJson("{\"CustomerName\":\"Contoso Ltd.\"}");
Console.WriteLine(result);
```

```vbnet
Dim result = textControl.LoadDataFromJson("{""CustomerName"":""Contoso Ltd.""}")
Console.WriteLine(result)
```

---

## Nearby

- **Previous:** [TextControl Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrol/constructor/llms-full.txt)
- **Next:** [TextControl.LoadDataFromModel Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web-mvc/textcontrol/loaddatafrommodel-method/llms-full.txt)
