# MainText Class

> The Web.MainText class represents the main text of a TX Text Control document. The Web.MainText class inherits from the Web.TextPart class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 22.0
- **Namespace:** `TXTextControl.Web`
- **Package:** `TXTextControl.Web` (assembly `TXTextControl.Web.DocumentEditor.dll`, from nuget.org, the private NuGet feed or Text Control Offline Packages)
- **Inherits:** `TXTextControl.Web.TextPart`
- **Implements:** `TXTextControl.Web.IFormattedText`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl.Web > MainText Class
- **405 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/maintext/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/maintext/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/maintext/llms-full.txt

---

### Description

The Web.MainText class represents the main text of a TX Text Control document. The Web.MainText class inherits from the [Web.TextPart](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/textpart/llms-full.txt) class.

### Syntax

```csharp
public class MainText : TextPart
```

```vbnet
Public Class MainText
    Inherits TextPart
```

### Examples

The following example inspects a Main Text object supplied by the document workflow.

```csharp
var currentValue = mainText.Selection;
Console.WriteLine($"Selection: {currentValue}");
```

```vbnet
Dim currentValue = mainText.Selection
Console.WriteLine($"Selection: {currentValue}")
```

---

## Nearby

- **Previous:** [IFormattedText.Selection Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/iformattedtext/selection-property/llms-full.txt)
- **Next:** [Selection Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol-web/selection/llms-full.txt)
