# Creating an ASP.NET Core Web Application using TXTextControl.Web

> The TX Text Control Online Document Editor TXTextControl.Web can be used in ASP.NET (.NET Framework) and ASP.NET Core Web Applications. This article shows how to create an ASP.NET Core Web Application using multi-platform NuGet package of TXTextControl.Web and Visual Studio 2019.

- **Author:** Bjoern Meyer
- **Published:** 2020-04-24
- **Modified:** 2025-11-16
- **Description:** This article shows how to create a  ASP.NET Core Web Application using the document editor.
- **3 min read** (438 words)
- **Tags:**
  - ASP.NET
  - Document Editor
  - .NET Core
- **Web URL:** https://www.textcontrol.com/blog/2020/04/24/creating-an-aspnet-core-web-application-using-txtextcontrolweb/
- **LLMs URL:** https://www.textcontrol.com/blog/2020/04/24/creating-an-aspnet-core-web-application-using-txtextcontrolweb/llms.txt
- **LLMs-Full URL:** https://www.textcontrol.com/blog/2020/04/24/creating-an-aspnet-core-web-application-using-txtextcontrolweb/llms-full.txt

---

This tutorial shows how to create a new ASP.NET Core Web Application using the TX Text Control Document Editor TXTextControl.Web using Visual Studio 2019.

For this tutorial, the setup of [TX Text Control .NET Server](https://www.textcontrol.com/product/tx-text-control-dotnet-server/) must be installed.

### Creating the Application

1. Open Visual Studio 2019, create a new project and select *ASP.NET Core Web Application* as the project template.
    
    ![ASP.NET Core Web Application](https://s1-www.textcontrol.com/assets/dist/blog/2020/04/24/b/assets/tutorial_1.webp "ASP.NET Core Web Application")
    
    Confirm with *Next*.
2. In the next dialog, specify a project name and location and confirm with *Create*.
3. In the next dialog, select *ASP.NET Core 2.1* or better from the available frameworks and choose *Web Application (Model-View-Controller) as the project template.*
    
    ![ASP.NET Core Web Application](https://s1-www.textcontrol.com/assets/dist/blog/2020/04/24/b/assets/tutorial_2.webp "ASP.NET Core Web Application")
    
    Finalize with *Create*.

### Adding the NuGet Package

4. In the *Solution Explorer*, select your created project and choose *Manage NuGet Packages...* from the *Project* main menu.
    
    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/2020/04/24/b/assets/tutorial_3.webp "ASP.NET Core Web Application")

### Configure the Application

5. Open the *Startup.cs* file located in the project's root folder. In the *Configure* method, add the following code to the end of the method:
    
    ```
    // enable local 'App_Data' folder to access local documents
    AppDomain.CurrentDomain.SetData("DataDirectory", System.IO.Path.Combine(env.ContentRootPath, "App_Data"));
    
    // 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>();
    ```
6. Select the project in the *Solution Explorer* and create a new folder named *App\_Data* by clicking *New Folder* from the *Project* main menu.
    
    Select the newly created folder *App\_Data* and click *Add Existing Item...* from the *Project* main menu.
    
    Browse to the following TX Text Control installation folder:
    
    *C:\\Program Files\\Text Control GmbH\\TX Text Control 28.0.NET Server for ASP.NET\\Samples\\Demo\\*
    
    Select the file *invoice.docx* confirm with *Add*.

### 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:
    
    ```
    @using TXTextControl.Web
    @using TXTextControl.Web.MVC
    
    @Html.TXTextControl().TextControl(settings =>
    {
        settings.Dock = DockStyle.Window;
    }).LoadText("App_Data/invoice.docx",StreamType.WordprocessingML).Render()
    ```

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

- [ASP.NET Core: Server-Side MailMerge](https://www.textcontrol.com/blog/2020/04/28/aspnet-core-server-side-mailmerge/llms.txt)
- [TXTextControl.Web for ASP.NET Core Web Applications Released](https://www.textcontrol.com/blog/2020/04/24/textcontrol-for-aspnet-core-web-released/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)
- [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)
- [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)
- [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)
- [Why Document Processing Libraries Require a Document Editor](https://www.textcontrol.com/blog/2025/12/04/why-document-processing-libraries-require-a-document-editor/llms.txt)
- [Getting Started Video Tutorial: Document Editor in ASP.NET Core C# on Linux](https://www.textcontrol.com/blog/2025/07/29/getting-started-video-tutorial-document-editor-aspnet-core-csharp-linux/llms.txt)
- [Document Protection in ASP.NET with TX Text Control: Healthcare Use Cases](https://www.textcontrol.com/blog/2025/06/25/document-protection-in-asp-dotnet-with-tx-text-control-healthcare-use-cases/llms.txt)
- [Deploying the TX Text Control Document Editor in an ASP.NET Core Web App to Azure App Services](https://www.textcontrol.com/blog/2025/03/26/deploying-the-tx-text-control-document-editor-in-an-asp-net-core-web-app-to-azure-app-services/llms.txt)
- [Building an ASP.NET Core Backend (Linux and Windows) for the Document Editor and Viewer](https://www.textcontrol.com/blog/2025/03/26/building-an-asp-net-core-backend-for-the-document-editor-and-viewer/llms.txt)
- [TX Text Control for Blazor: Mail Merge Integration Tutorial](https://www.textcontrol.com/blog/2025/03/25/tx-text-control-for-blazor-mail-merge-integration-tutorial/llms.txt)
- [TX Text Control Document Editor and Viewer for Blazor Released](https://www.textcontrol.com/blog/2025/03/25/tx-text-control-document-editor-and-viewer-for-blazor-released/llms.txt)
- [Getting Started: Document Editor for Blazor in ASP.NET Core](https://www.textcontrol.com/blog/2025/03/25/getting-started-document-editor-for-blazor-in-asp-net-core/llms.txt)
- [Introducing TXTextControl.Web.Server.Core: A Cross-Platform Backend for TX Text Control Document Editor](https://www.textcontrol.com/blog/2025/03/13/introducing-txtextcontrol-web-server-core-a-cross-platform-backend-for-tx-text-control-document-editor/llms.txt)
- [Getting Started: Document Editor with ASP.NET Core and Docker Support with Linux Containers](https://www.textcontrol.com/blog/2025/03/12/getting-started-document-editor-with-asp-net-core-and-docker-support-with-linux-containers/llms.txt)
- [Announcing Our Work on a Blazor Component for Document Editing and Viewing](https://www.textcontrol.com/blog/2025/01/24/announcing-our-work-on-a-blazor-component-for-document-editing-and-viewing/llms.txt)
- [Preparing Documents for E-Signing for Multiple Signers in .NET C#](https://www.textcontrol.com/blog/2024/11/13/preparing-documents-for-e-signing-for-multiple-signers-in-net-c-sharp/llms.txt)
- [ASP.NET Core: Use the Document Editor and Viewer in the Same Razor View](https://www.textcontrol.com/blog/2024/11/08/asp-net-core-use-the-document-editor-and-viewer-in-the-same-razor-view/llms.txt)
- [Connecting the TXWebSocketMiddleware to a Separate, External TCP Synchronization Service](https://www.textcontrol.com/blog/2024/10/01/connecting-the-txwebsocketmiddleware-to-a-separate-external-tcp-synchronization-service/llms.txt)
- [Getting Started: Creating an ASP.NET Core Web App with the Document Editor in Visual Studio Code (VS Code)](https://www.textcontrol.com/blog/2024/09/27/getting-started-creating-an-asp-net-core-web-app-with-the-document-editor-in-visual-studio-code-vs-code/llms.txt)
- [Getting Started Video Tutorial: How to use the Document Editor in ASP.NET Core C#](https://www.textcontrol.com/blog/2024/08/05/getting-started-video-tutorial-how-to-use-the-document-editor-in-asp-net-core-csharp/llms.txt)
- [Observe When the Reporting Preview Tab is Active Using MutationObserver](https://www.textcontrol.com/blog/2024/07/23/observe-when-the-reporting-preview-tab-is-active-using-mutationobserver/llms.txt)
- [Removing Empty Pages in TX Text Control with JavaScript](https://www.textcontrol.com/blog/2024/06/19/removing-empty-pages-in-tx-textcontrol-with-javascript/llms.txt)
