# Getting Started: Document Editor with ASP.NET MVC (.NET Framework)

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

- **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 Framework web application in Visual Studio 2022.
- **3 min read** (435 words)
- **Tags:**
  - ASP.NET
  - Getting Started
  - MVC
- **LLMs.txt URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-framework/llms.txt
- **LLMs-full.txt URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-framework/llms-full.txt
- **Canonical URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-framework/

---

The following tutorial shows how to create an ASP.NET (Framework) web application that uses the Document Editor.

> ### 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/)  
>     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.

1. In Visual Studio 2022, create a new project by choosing *Create a new project*.
2. Select *ASP.NET Web Application (.NET Framework)* as the project template and confirm with *Next*.
3. Choose a name for your project, select *.NET Framework 4.8* as the *Framework* and confirm with *Create*.
4. In the next dialog, choose *MVC* as the project template, check *Web API* from the *Add folders & core references* selection and confirm with *Create*.
    
    ![Creating the .NET 6 project](https://s1-www.textcontrol.com/assets/dist/blog/2022/09/01/d/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/d/assets/visualstudio2.webp "ASP.NET Core Web Application")

#### Adding the Control to the View

6. 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/api/TXWebSocket?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 Viewer with ASP.NET MVC (.NET Framework)](https://www.textcontrol.com/blog/2022/09/01/getting-started-document-viewer-with-aspnet-framework/llms.txt)
- [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)
- [Getting Started: Document Editor with ASP.NET Web Forms (.NET Framework)](https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-web-forms/llms.txt)
- [Getting Started: ServerTextControl and MailMerge with ASP.NET MVC (.NET Framework)](https://www.textcontrol.com/blog/2022/09/01/getting-started-servertextcontrol-and-mailmerge-with-aspnet-net-framework/llms.txt)
- [Getting Started: Document Editor with ASP.NET Core](https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-core/llms.txt)
- [New Getting Started Article Hub Launched](https://www.textcontrol.com/blog/2022/07/11/new-getting-started-article-hub-launched/llms.txt)
- [New Getting Started Hub Released](https://www.textcontrol.com/blog/2022/01/18/new-getting-started-hub-released/llms.txt)
- [Detect Toggle Button Changes Using a MutationObserver](https://www.textcontrol.com/blog/2021/11/11/detect-toggle-button-changes-using-a-mutationobserver/llms.txt)
- [Using the MVC DocumentViewer in ASP.NET Web Forms](https://www.textcontrol.com/blog/2021/08/12/using-the-mvc-documentviewer-in-aspnet-web-forms/llms.txt)
- [Creation of Custom Electronic Signature Boxes](https://www.textcontrol.com/blog/2021/06/15/creation-of-custom-electronic-signature-boxes/llms.txt)
- [DocumentViewer Preview: Completing Form Fields](https://www.textcontrol.com/blog/2021/04/15/document-viewer-preview-completing-form-fields/llms.txt)
- [Implementing Conditional Table Cell Colors with MailMerge](https://www.textcontrol.com/blog/2020/10/08/implementing-conditional-table-cell-colors-with-mailmerge/llms.txt)
- [DocumentViewer for .NET Core 3.1 Released](https://www.textcontrol.com/blog/2020/04/08/documentviewer-for-dotnet-core-released/llms.txt)
- [Document Collaboration: Implementing Comments with Document Targets](https://www.textcontrol.com/blog/2020/04/06/implementing-comments-with-document-targets/llms.txt)
- [MVC NuGet Packages for X18 Published](https://www.textcontrol.com/blog/2020/03/17/mvc-nuget-packages-for-x18-published/llms.txt)
- [Configuring ASP.NET and IIS for Larger Requests](https://www.textcontrol.com/blog/2019/12/20/documentviewer-configuring-aspnet-for-larger-requests/llms.txt)
- [Updated MVC DocumentViewer: Session-less and Improved Image Quality](https://www.textcontrol.com/blog/2019/12/12/updated-mvc-documentviewer-session-less-and-improved-image-quality/llms.txt)
- [Using Multiple Electronic Signatures on a Document](https://www.textcontrol.com/blog/2019/10/23/using-multiple-electronic-signatures/llms.txt)
- [MVC DocumentViewer Update: Printing, Resources and Mobile-Friendly Document Signing](https://www.textcontrol.com/blog/2019/10/18/mvc-documentviewer-update-printing-resources-mobile/llms.txt)
- [ReportingCloud .NET Core Quickstart Tutorial](https://www.textcontrol.com/blog/2019/07/24/reportingcloud-dotnet-core-quickstart-tutorial/llms.txt)
- [MVC: Loading and Saving Documents Directly Server-Side](https://www.textcontrol.com/blog/2019/07/23/mvc-loading-and-saving-documents-directly-server-side/llms.txt)
- [TextControl.Web: Restoring the Scroll Location](https://www.textcontrol.com/blog/2019/07/22/restoring-the-scroll-location/llms.txt)
- [Loading and Saving User Dictionaries in TextControl.Web](https://www.textcontrol.com/blog/2019/07/19/loading-and-saving-user-dictionaries-in-textcontrol-web/llms.txt)
- [Using TX Text Control MVC in Partial Views](https://www.textcontrol.com/blog/2019/04/17/using-tx-text-control-mvc-in-partial-views/llms.txt)
- [MVC DocumentViewer: Loading Documents](https://www.textcontrol.com/blog/2018/07/03/mvc-documentviewer-loading-documents/llms.txt)
