Products Technologies Demo Docs Blog Support Company

ASP.NET DocumentEditor: Set Static Files Path

In recent versions, the static files path had to be defined for all routes in where the editor is used. A new property has been introduced to define the static files path once for all routes.

ASP.NET DocumentEditor: Set Static Files Path

In recent versions, the static files path had to be defined for all routes in where the editor is used. In version 30.0, a new property has been introduced to define the static files path once for all routes. Previously, each path, where the editor was used, had to be defined individually in the Startup.cs like this:

// 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 = "/envelope/create/TXTextControl.Web"
});

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 = "/collaboration/edit/TXTextControl.Web"
});

In the above sample, the static files can be found from the following routes:

  • .../envelope/create/
  • .../collaboration/edit/

In version 30.0, by default, the static files are expected in the TXTextControl.Web folder location in the root of your web application.

For the above sample, only the following code is required in the Startup.cs:

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"
});

If the editor is used in any path in the application in a view, the static files are now found automatically:

@Html.TXTextControl().TextControl(settings => {
   settings.Dock = TXTextControl.Web.DockStyle.Fill;
}).Render()

The virtual folder location and name of the static files can be changed in the Startup.cs (TXTextControl.Web.MyName in this case):

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.MyName"
});

Then, this path can be defined in the view using the StaticFilesPath property:

@Html.TXTextControl().TextControl(settings => {
   settings.Dock = TXTextControl.Web.DockStyle.Fill;
   settings.StaticFilesPath = "/TXTextControl.Web.MyName";
}).Render()

Learn more about the other new features, improvements and changes of TX Text Control 30.0:

What's New in Version 30.0?

Stay in the loop!

Subscribe to the newsletter to receive the latest updates.

ASP.NET

Integrate document processing into your applications to create documents such as PDFs and MS Word documents, including client-side document editing, viewing, and electronic signatures.

ASP.NET Core
Angular
Blazor
JavaScript
React
  • Angular
  • Blazor
  • React
  • JavaScript
  • ASP.NET MVC, ASP.NET Core, and WebForms

Learn more Trial token Download trial

Related Posts

ASP.NETASP.NET CorePDF/UA

PDF/UA vs. PDF/A-3a: Which Format Should You Use for Your Business Application?

In this blog post, we will explore the differences between PDF/UA and PDF/A-3a, helping you choose the right format for your business needs. We will discuss the key features, benefits, and use…


ASP.NETASP.NET CorePDF/UA

Validating PDF/UA Documents in .NET C#

Creating accessible and compliant PDF documents is becoming an increasingly important requirement across industries. In this blog post, we explore how to validate PDF/UA documents using Text…


ASP.NETWindows FormsWPF

Sneak Peek: TX Text Control 34.0 Coming November 2025

We are excited to announce the upcoming release of TX Text Control 34.0, scheduled for November 2025. This update brings a host of new features and improvements to enhance your document processing…


ASP.NETWindows FormsWPF

TX Text Control 33.0 SP3 is Now Available: What's New in the Latest Version

TX Text Control 33.0 Service Pack 3 is now available, offering important updates and bug fixes for all platforms. If you use TX Text Control in your document processing applications, this service…


ASP.NETASP.NET CoreDocument Viewer

High-Performance Text Replacement in Large DOCX Files using C# .NET

Learn how to efficiently replace text in large DOCX files using C# .NET and the ServerTextControl component from Text Control. This article demonstrates the performance benefits of using the…