# Getting Started: Document Editor with ASP.NET Core

> This article shows how to use the TX Text Control ASP.NET document editor within a .NET 6 application in Visual Studio 2022.

> **Note:** This article is outdated and may no longer be accurate.

- **Author:** Bjoern Meyer
- **Published:** 2022-09-01
- **Modified:** 2025-11-16
- **Description:** This article shows how to use the TX Text Control ASP.NET document editor within a .NET 6 application in Visual Studio 2022.
- **3 min read** (507 words)
- **Tags:**
  - ASP.NET
  - ASP.NET Core
  - Getting Started
- **Web URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-core/
- **LLMs URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-core/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-core/llms-full.txt

---

> ### Prerequisites
> 
> There are two ways to evaluate the TX Text Control *Document Editor*. You can either host your own backend by downloading the trial version of TX Text Control .NET Server, or by creating a trial access token to use a hosted backend, valid for 30 days:
> 
> - [Download Trial Version](https://www.textcontrol.com/product/tx-text-control-dotnet-server/download/)  
>     Setup download and installation required.
> - [Create Trial Access Token](https://www.textcontrol.com/product/client-package/token/)  
>     No download and local installation required.

### Creating the Application

Make sure that you downloaded the latest version of Visual Studio 2022 that comes with the [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0).

1. In Visual Studio 2022, create a new project by choosing *Create a new project*.
2. Select *ASP.NET Core Web App (Model-View-Controller)* as the project template and confirm with *Next*.
3. Choose a name for your project and confirm with *Next*.
4. In the next dialog, choose *.NET 6 (Long-term support)* as the *Framework* and confirm with *Create*.
    
    ![Creating the .NET 6 project](https://s1-www.textcontrol.com/assets/dist/blog/2022/09/01/a/assets/visualstudio1.webp "Creating the .NET 6 project")

#### Adding the NuGet Package

5. In the *Solution Explorer*, select your created project and choose *Manage NuGet Packages...* from the *Project* main menu.
    
    > **Package Source**
    > 
    > Select either **Text Control Offline Packages** or **nuget.org** as the *Package source*. Packages in the official *Text Control* NuGet profile are frequently updated.
    > 
    > In case you are using a **Trial Access Token**, please choose *nuget.org*.
    
    Browse for *txtextcontrol.web* and *Install* the latest version of the *TXTextControl.Web* package.
    
    ![ASP.NET Core Web Application](https://s1-www.textcontrol.com/assets/dist/blog/2022/09/01/a/assets/visualstudio2.webp "ASP.NET Core Web Application")

#### Configure the Application

> **Trial Access Token Users**
> 
> In case you are using a **Trial Access Token**, skip step 6 and [continue with step 7](#adding-the-control-to-the-view).

6. Open the *Program.cs* file located in the project's root folder. Add the following code after the entry `app.UseStaticFiles();`:
    
    ```
    // serve static linked files (JavaScript and CSS for the editor)
    app.UseStaticFiles(new StaticFileOptions
    {
        FileProvider = new Microsoft.Extensions.FileProviders.PhysicalFileProvider(
           System.IO.Path.Combine(System.IO.Path.GetDirectoryName(
               System.Reflection.Assembly.GetEntryAssembly().Location),
               "TXTextControl.Web")),
        RequestPath = "/TXTextControl.Web"
    });
    
    // enable Web Sockets
    app.UseWebSockets();
    
    // attach the Text Control WebSocketHandler middleware
    app.UseMiddleware<TXTextControl.Web.WebSocketMiddleware>();
    ```

#### Adding the Control to the View

7. Find the *Index.cshtml* file in the *Views -> Home* folder. Replace the complete content with the following code to add the document editor to the view:
    
    ```
    @using TXTextControl.Web.MVC
        
    @{
        var sDocument = "<html><body><p>Welcome to <strong>Text Control</strong></p></body></html>";
    }
    
    @Html.TXTextControl().TextControl(settings => {
        settings.UserNames = new string[] { "Tim Typer" };
    }).LoadText(sDocument, TXTextControl.Web.StringStreamType.HTMLFormat).Render()
    
    <input type="button" onclick="insertTable()" value="Insert Table" />
    
    <script>
        function insertTable() {
            TXTextControl.tables.add(5, 5, 10, function(e) {
              if (e === true) { // if added
                TXTextControl.tables.getItem(function(table) {
                  table.cells.forEach(function(cell) {
    
                    cell.setText("Cell text");
    
                  });
                }, null, 10);
              }
            })
        }
    </script>
    ```
    
    > **Trial Access Token Users**
    > 
    > In case you are using a **Trial Access Token**, replace the content with the following code.
    > 
    > ```
    > @using TXTextControl.Web.MVC
    > 	
    > @Html.TXTextControl().TextControl(settings => {
    > 	settings.WebSocketURL = "wss://backend.textcontrol.com?access-token=addYourTokenHere"
    > }).Render()
    > ```
    > 
    > Replace *addYourTokenHere* with your actual **Trial Access Token**.

Compile and start the application.

---

## About Bjoern Meyer

As CEO, Bjoern is the visionary behind our strategic direction and business development, bridging the gap between our customers and engineering teams. His deep passion for coding and web technologies drives the creation of innovative products. If you're at a tech conference, be sure to stop by our booth - you'll most likely meet Bjoern in person. With an advanced graduate degree (Dipl. Inf.) in Computer Science, specializing in AI, from the University of Bremen, Bjoern brings significant expertise to his role. In his spare time, Bjoern enjoys running, paragliding, mountain biking, and playing the piano.

- [LinkedIn](https://www.linkedin.com/in/bjoernmeyer/)
- [X](https://x.com/txbjoern)
- [GitHub](https://github.com/bjoerntx)

---

## Related Posts

- [Getting Started: Document Editor with ASP.NET Core](https://www.textcontrol.com/blog/2023/09/13/getting-started-document-editor-with-aspnet-core/llms.txt)
- [5 Layout Patterns for Integrating the TX Text Control Document Editor in ASP.NET Core C#](https://www.textcontrol.com/blog/2026/04/09/5-layout-patterns-for-integrating-the-tx-text-control-document-editor-in-aspnet-core-csharp/llms.txt)
- [Extracting Structured Table Data from DOCX Word Documents in C# .NET with Domain-Aware Table Detection](https://www.textcontrol.com/blog/2026/04/03/extracting-structured-table-data-from-docx-word-documents-in-csharp-dotnet-with-domain-aware-table-detection/llms.txt)
- [Introducing Text Control Agent Skills](https://www.textcontrol.com/blog/2026/03/27/introducing-text-control-agent-skills/llms.txt)
- [Deploying the TX Text Control Document Editor from the Private NuGet Feed to Azure App Services (Linux and Windows)](https://www.textcontrol.com/blog/2026/03/25/deploying-the-tx-text-control-document-editor-from-the-private-nuget-feed-to-azure-app-services-linux-and-windows/llms.txt)
- [Why Structured E-Invoices Still Need Tamper Protection using C# and .NET](https://www.textcontrol.com/blog/2026/03/24/why-structured-e-invoices-still-need-tamper-protection-using-csharp-and-dotnet/llms.txt)
- [AI Generated PDFs, PDF/UA, and Compliance Risk: Why Accessible Document Generation Must Be Built Into the Pipeline in C# .NET](https://www.textcontrol.com/blog/2026/03/23/ai-generated-pdfs-pdf-ua-and-compliance-risk-why-accessible-document-generation-must-be-built-into-the-pipeline-in-c-sharp-dot-net/llms.txt)
- [File Based Document Repository with Version Control in .NET with TX Text Control](https://www.textcontrol.com/blog/2026/03/20/file-based-document-repository-with-version-control-in-dotnet/llms.txt)
- [Create Fillable PDFs from HTML Forms in C# ASP.NET Core Using a WYSIWYG Template](https://www.textcontrol.com/blog/2026/03/17/create-fillable-pdfs-from-html-forms-in-csharp-aspnet-core-using-a-wysiwyg-template/llms.txt)
- [Why HTML to PDF Conversion is Often the Wrong Choice for Business Documents in C# .NET](https://www.textcontrol.com/blog/2026/03/13/why-html-to-pdf-conversion-is-often-the-wrong-choice-for-business-documents-in-csharp-dot-net/llms.txt)
- [Inspect and Process Track Changes in DOCX Documents with TX Text Control with .NET C#](https://www.textcontrol.com/blog/2026/03/10/inspect-and-process-track-changes-in-docx-documents-with-tx-text-control-with-dotnet-csharp/llms.txt)
- [Text Control at BASTA! Spring 2026 in Frankfurt](https://www.textcontrol.com/blog/2026/03/06/text-control-at-basta-spring-2026-in-frankfurt/llms.txt)
- [From Legacy Microsoft Office Automation to a Future-Ready Document Pipeline with C# .NET](https://www.textcontrol.com/blog/2026/03/02/from-legacy-microsoft-office-automation-to-a-future-ready-document-pipeline-with-csharp-dot-net/llms.txt)
- [We are Gold Partner at Techorama Belgium 2026](https://www.textcontrol.com/blog/2026/02/26/we-are-gold-partner-techorama-belgium-2026/llms.txt)
- [Text Control Sponsors & Exhibits at BASTA! Spring 2026 in Frankfurt](https://www.textcontrol.com/blog/2026/02/26/text-control-sponsors-exhibits-basta-spring-2026-frankfurt/llms.txt)
- [Azure DevOps with TX Text Control .NET Server 34.0: Private NuGet Feed and Azure Artifacts](https://www.textcontrol.com/blog/2026/02/25/azure-devops-with-tx-text-control-dotnet-server-34-0-private-nuget-feed-and-azure-artifacts/llms.txt)
- [TX Text Control 34.0 SP2 is Now Available: What's New in the Latest Version](https://www.textcontrol.com/blog/2026/02/18/tx-text-control-34-0-sp2-is-now-available/llms.txt)
- [Build a Custom Backstage View in ASP.NET Core with TX Text Control](https://www.textcontrol.com/blog/2026/02/17/build-a-custom-backstage-view-in-aspnet-core-with-tx-text-control/llms.txt)
- [Configuring Web.Server.Core for TX Text Control Document Editor: Changing Ports and IP Versions](https://www.textcontrol.com/blog/2026/02/12/configuring-web-server-core-for-tx-text-control-document-editor-changing-ports-and-ip-versions/llms.txt)
- [Software Origin, Compliance, and Trust: Made in Germany](https://www.textcontrol.com/blog/2026/02/11/software-origin-compliance-and-trust-made-in-germany/llms.txt)
- [Building a TX Text Control Project with GitHub Actions and the Text Control NuGet Feed](https://www.textcontrol.com/blog/2026/02/09/building-a-tx-text-control-project-with-github-actions-and-the-text-control-nuget-feed/llms.txt)
- [ASP.NET Core Document Editor with Backend via the Text Control Private NuGet Feed](https://www.textcontrol.com/blog/2026/02/09/aspnet-core-document-editor-private-nuget-feed/llms.txt)
- [Text Control Private NuGet Feed](https://www.textcontrol.com/blog/2026/02/09/text-control-private-nuget-feed/llms.txt)
- [Secure by Design: Dynamic Watermarking for Enterprise Documents in C# .NET](https://www.textcontrol.com/blog/2026/02/06/secure-by-design-dynamic-watermarking-for-enterprise-documents-in-csharp-dotnet/llms.txt)
- [A Rule-Based PHI and PII Risk Scanner for Documents Using C# .NET](https://www.textcontrol.com/blog/2026/02/03/a-rule-based-phi-and-pii-risk-scanner-for-documents-using-csharp-dotnet/llms.txt)
