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.
-
Click Manage NuGet Packages... from the Project main menu.
-
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.
-
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersusing System.Web.Http; public class WebApiConfig { public static void Register(HttpConfiguration configuration) { configuration.Routes.MapHttpRoute("API Default", "api/{controller}/{id}", new { id = RouteParameter.Optional }); } } -
Import the namespace System.Web.Http in Global.asax.cs.
-
In the file Global.asax.cs, call GlobalConfiguration.Configure(WebApiConfig.Register); in MvcApplication.Application_Start() before registering the default web application route:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersprotected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); }
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.