# TableOfContents.HasPageNumbers Property

> Gets or sets a value specifying whether the table of contents contains page numbers.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 29.0
- **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 > TableOfContents.HasPageNumbers Property
- **522 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/haspagenumbers-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/haspagenumbers-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/haspagenumbers-property/llms-full.txt

---

### Description

Gets or sets a value specifying whether the table of contents contains page numbers.

### Syntax

```csharp
public bool HasPageNumbers { get; set; }
```

```vbnet
Public Property HasPageNumbers As Boolean
```

### Examples

The following example creates a table of contents for the document's heading styles by using `TableOfContents.HasPageNumbers`.

```csharp
TableOfContents tableOfContents = new(1, 3) { Name = "Contents", ID = 10 };
textControl.TablesOfContents.Add(tableOfContents);

tableOfContents.HasPageNumbers = true;
if (tableOfContents.HasPageNumbers)
{
    Console.WriteLine("Table Of Contents: Has Page Numbers is enabled.");
}
```

```vbnet
Dim tableOfContents As New TableOfContents(1, 3) With { .Name = "Contents", .ID = 10 }
textControl.TablesOfContents.Add(tableOfContents)

tableOfContents.HasPageNumbers = True
If tableOfContents.HasPageNumbers Then
    Console.WriteLine("Table Of Contents: Has Page Numbers is enabled.")
End If
```

---

## Nearby

- **Previous:** [TableOfContents.HasLinks Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/haslinks-property/llms-full.txt)
- **Next:** [TableOfContents.HasRightAlignedPageNumbers Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/hasrightalignedpagenumbers-property/llms-full.txt)
