# TextField.Text Property

> Returns or sets the text which is contained within a text field. This property is not supported for the DocumentTarget class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > TextField.Text Property
- **620 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textfield/text-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textfield/text-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textfield/text-property/llms-full.txt

---

### Description

Returns or sets the text which is contained within a text field. This property is not supported for the [DocumentTarget](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/documenttarget/llms-full.txt) class.

### Syntax

```csharp
public string Text { get; set; }
```

```vbnet
Public Property Text As String
```

### Examples

The following example inserts a Word-compatible text field into a template by using `TextField.Text`.

```csharp
TextField textField = new ApplicationField(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer name", new[] { "CustomerName" });
textControl.TextFields.Add(textField);

textField.Text = "Quarterly results";
if (!string.IsNullOrWhiteSpace(textField.Text))
{
    Console.WriteLine($"Text: {textField.Text}");
}
```

```vbnet
Dim textField As TextField = New ApplicationField(ApplicationFieldFormat.MSWord, "MERGEFIELD", "Customer name", New String() { "CustomerName" })
textControl.TextFields.Add(textField)

textField.Text = "Quarterly results"
If Not String.IsNullOrWhiteSpace(textField.Text) Then
    Console.WriteLine($"Text: {textField.Text}")
End If
```

---

## Nearby

- **Previous:** [TextField.Start Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textfield/start-property/llms-full.txt)
- **Next:** [TextFieldCollection Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/textfieldcollection/llms-full.txt)
