Use RTE in MVC

An award-winning wysiwyg editor control for ASP.NET.

Use RTE in ASP.NET MVC

In this article we will discuss how to use RTE with ASP.NET MVC. The sample applications using the Razor view engine are included in the download package.

1. Install the assembly

Copy the following files to your application bin folder.

  • richtexteditor.dll
  • NetSpell.SpellChecker.dll
  • richtexteditor.lic

The "richtexteditor" folder and all files it contains should be deployed to the directory of your MVC website.

2. Add Uploader httpModule to web.config's httpModules list

To allow RichTextEditor to upload big files, you need to add Uploader HttpModule to your application.

IIS Integrated mode

<configuration>
  <system.webServer>
    <modules>
      <add name="UploadModule" type="RTE.UploadModule,RichTextEditor"/>
    </modules>
  </system.webServer>
</configuration>

IIS Classic mode

<configuration>
  <system.web>
    <httpModules>
      <add name="UploadModule" type="RTE.UploadModule,RichTextEditor"/>
     </httpModules>
  </system.web>
</configuration>
3. Using the Editor in a MVC page (.cshtml)

a. Register RichTextEditor control in MVC controller and use Editor.LoadFormData method to load content into the RTE

Editor Editor1 = new Editor(System.Web.HttpContext.Current, "Editor1");
Editor1.LoadFormData("Type here...");
Editor1.MvcInit();
ViewBag.Editor = Editor1.MvcGetString();

b. Insert a RTE instance into the page

@Html.Raw(ViewBag.Editor)

Useful links

Trusted by great companies

  • Sony
  • Siemens
  • nokia
  • ibm
  • intel
  • microsoft

25,000 Customers

Rich Text Editor has more than 25,000 customers, and has been sold in over 60 countries.

23 languages are supported, and more are being added.