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

> This article shows how to use the TX Text Control ASP.NET document editor within a Web Forms 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 Web Forms application in Visual Studio 2022.
- **2 min read** (253 words)
- **Tags:**
  - ASP.NET
  - ASP.NET Web Forms
  - Getting Started
- **LLMs.txt URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-web-forms/llms.txt
- **LLMs-full.txt URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-web-forms/llms-full.txt
- **Canonical URL:** https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-web-forms/

---

### 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 *Web Forms* as the project template and confirm with *Create*.
    
    ![Creating the .NET 6 project](https://s1-www.textcontrol.com/assets/dist/blog/2022/09/01/g/assets/visualstudio1.webp "Creating the .NET 6 project")

#### Adding TX Text Control References

5. While the project is selected in the *Solution Explorer*, choose *Project -> Add Project Reference...* to open the *Reference Manager*. In the opened dialog, select *Browse...* to select the required TX Text Control assemblies. Navigate to the installation folder of TX Text Control and select the following assembly from the *Assembly* folder:
    
    
    - TXTextControl.Web.dll
    
    After selecting this assembly, click *Add* and close the *Reference Manager* by confirming with *OK*.

#### Adding the Control to the View

6. Find the *Default.aspx* file in the project's root folder. Except the first code line, remove the complete code and replace it with the following code:
    
    ```
    <%@ Register Assembly="TXTextControl.Web" Namespace="TXTextControl.Web" TagPrefix="cc1" %>
    
    <asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
    <cc1:TextControl ID="TextControl1" runat="server" />
    
    <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>
    
    </asp:Content>
    ```
7. Find the *Web.config* file in the project's root folder and add the following entry after the opening *configuration* element:
    
    ```
    <system.webServer>
    <handlers>
    <add name="TXWebSocketHandler" verb="*" path="TXWebSocketHandler.ashx" type="TXTextControl.Web.WebSocketHandler, TXTextControl.Web, Version=32.0.1200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
    <add name="TXPrintHandler" verb="*" path="TXPrintHandler.ashx" type="TXTextControl.Web.TXPrintHandler, TXTextControl.Web, Version=32.0.1200.500, Culture=neutral, PublicKeyToken=6B83FE9A75CFB638" />
    </handlers>
    </system.webServer>
    ```

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)
- [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 MVC (.NET Framework)](https://www.textcontrol.com/blog/2022/09/01/getting-started-document-editor-with-aspnet-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)
