aspnetmvc-114045-components-rich-text-editor.md
The Rich Text Editor is a Word-inspired extension that allows you to introduce a rich text editing functionality to any ASP.NET MVC application with ease. It provides a rich UI and comprehensive API to create, manage and convert documents containing rich text formatting.
To learn more about the Rich Text Editor and see it in action, refer to the Rich Text Editor for ASP.NET MVC demos.
The Rich Text Editor extension is implemented by the RichEditExtension class. To access its instance, use the RichEdit(RichEditSettings) helper method, which is used to add a Rich Text Editor extension to a view. This method’s parameter provides access to the Rich Text Editor settings implemented by the RichEditSettings class.
The Rich Text Editor ‘s client counterpart is represented by the MVCxClientRichEdit object.
The code sample below demonstrates how to add a Rich Text Editor to a project and open a document within it.
View code - “Index”:
@using(Html.BeginForm()) {
@Html.Partial("RichEditPartial")
}
Note
To enable the file downloading and uploading functionality, the Partial View with the extension must be wrapped with the HTML form. Since this functionality is implemented through the UploadControl extension, it’s also necessary to fulfill all the recommendations from the following topic: Upload Control Troubleshooting.
Partial View code - “RichEditPartial”:
@Html.DevExpress().RichEdit(settings => {
settings.Name = "RichEdit";
settings.CallbackRouteValues = new { Controller = "Home", Action = "RichEditPartial" };
}).Open(Server.MapPath("~/App_Data/Documents/Overview.rtf")).GetHtml()
Controller (“Home”):
public class HomeController : Controller{
public ActionResult Index(){
return View();
}
public ActionResult RichEditPartial(){
return PartialView("RichEditPartial");
}
}
Note
The Partial View should contain only the extension’s code.
The image below illustrates the result.
The DevExpress ASP.NET MVC Rich Text Editor allows you to introduce Microsoft® Word®-like text editing features into your next web application with ease. The Rich Text Editor is implemented as the RichEdit(RichEditSettings) extension, which provides advanced text formatting capabilities and delivers numerous end-user options, helping you deliver compelling business solutions.
Note
The MVC RichEdit extension has the same functionality as the Web Forms ASPxRichEdit control. For this reason, the Learn More links in this section navigate to Web Forms topics.
Various popular formats are supported to load, convert and save documents - DOC, DOCX, RTF, HTML, MHT, XML, ODT, TXT. Documents can be exported to PDF. Learn more…
See demo: Load/Save | See demo: Export to PDF
Field Support
Document Variables Support
Mail Merge
The RichEdit provides all formatting features you would expect from a word processor.
Character Formatting
Paragraph Formatting
Bulleted and Numbered Lists
Styles
Tables
Undo/Redo History
Clipboard Operations Support
Inline Pictures
Bookmarks
Hyperlinks
Drag and Drop Support
Spell Checking
Full-text Search
Support for Document Sections
Page Settings Customization
Multi-column Layout
Section Breaks
Headers and Footers
Operation Restrictions
Document Restrictions
The RichEdit provides a UI experience similar to that of Microsoft® Word®.
Ribbon UI
Advanced Context Menus and Built-in Dialogs
UI for Printing
Horizontal Ruler
Status Bar
Fullscreen Mode
Server-Side API
Client-Side API
All DevExpress ASP.NET controls and ASP.NET MVC extensions use the same approach to localize their UI. Read more…