TXTextControl.Web.MVC is using the ASP.NET Web API framework to synchronize the edited document with the server in order to render the output in a true WYSIWYG manner.

From Microsoft MSDN:

ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.

In our MVC tutorial, we describe how to create a new ASP.NET MVC project with Web API support. But very often, TX Text Control is added to existing MVC projects. This tutorial shows how to add ASP.NET Web API support to an existing MVC project.

  1. Click Manage NuGet Packages... from the Project main menu.

  2. Set the Package source to nuget.org and search for Microsoft.AspNet.WebApi. Select the package Microsoft.AspNet.WebApi and click on Install. Accept the license for all 4 packages by clicking I Accept.

    Adding ASP.NET Web API support to an existing ASP.NET MVC project
  3. In the Solution Explorer, select the folder App_Start and choose Add New Item... from the Project main menu. Select Class as the new item and name it WebApiConfig.cs. Confirm with Add.

    Add the following code to the newly created config file and import the namespace System.Web.Http:

    using System.Web.Http;
    public class WebApiConfig
    {
    public static void Register(HttpConfiguration configuration)
    {
    configuration.Routes.MapHttpRoute("API Default", "api/{controller}/{id}",
    new { id = RouteParameter.Optional });
    }
    }
    view raw WebApiConfig.cs hosted with ❤ by GitHub
  4. Import the namespace System.Web.Http in Global.asax.cs.

  5. In the file Global.asax.cs, call GlobalConfiguration.Configure(WebApiConfig.Register); in MvcApplication.Application_Start() before registering the default web application route:

    protected void Application_Start()
    {
    GlobalConfiguration.Configure(WebApiConfig.Register);
    AreaRegistration.RegisterAllAreas();
    RouteConfig.RegisterRoutes(RouteTable.Routes);
    }
    view raw Global.asax.cs hosted with ❤ by GitHub

That's it - you added Web API support to your ASP.NET MVC project. Now, you can use the TXTextControl.Web.MVC HtmlHelper in your web application.