[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
   Reporting
  [Expand]Charting
  [Expand]Pivot Grid
   Spreadsheet
   Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Collapse]HTML Editor
   [Expand]Visual Elements
   [Expand]Animated Images
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Extensions
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

HTML Editor

The DevExpress HtmlEditor is a rich-text WYSIWYG HTML editor extension for ASP.NET MVC. Its intuitive user interface enables even inexperienced users to edit HTML page content with ease.

To learn more about HtmlEditor and see it in action, refer to its online demos.

Expanded Implementation Details

HtmlEditor is realized by the HtmlEditorExtension class. Its instance can be accessed via the ExtensionsFactory.HtmlEditor helper method, which is used to add a HtmlEditor extension to a view. This method's parameter provides access to the HtmlEditor's settings implemented by the HtmlEditorSettings class, allowing you to fully customize the extension.

HtmlEditor's client counterpart is represented by the MVCxClientHtmlEditor object.

Expanded Declaration

HtmlEditor can be added to a view in the following manner.

View code - "Index" (Razor):

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 corresponding KB article.

Note

The Partial View should contain only the extension's code.

Partial View code - "HtmlEditorPartial" (Razor):

Controller ("Home"):

The code result is demonstrated in the image below.

Expanded Main Features

HTMLEditor's intuitive user interface allows end-users to edit HTML page content with ease. Key features include:

  • Predefined tools for content formatting (modifying fonts, paragraphs, inserting images and links, etc.) (See demo: Features)
  • Support for custom toolbars and toolbar items (See demo: Custom Toolbar Items)
  • Three views to modify and preview content - Design View, HTML View, Preview
  • Sizing capabilities (Show Me)
  • Full-screen mode (Show Me)
  • Customizable automatic content validation and transformation into XHTML 1.0 Transitional compliant markup
  • Customizable response to ENTER key presses (ASPxHtmlEditorHtmlEditingSettings.EnterMode)
  • Custom CSS (See demo: Custom CSS)
  • Built-in Spell Checker (See demo: Spell Checking)
  • Table Support (See demo: Tables)
  • Built-in content validation capabilities (See demo: Validation)
  • Support for custom dialogs (See demo: Custom Dialogs)
  • Built-in support for import and export. (See demo: Import/Export)

Is this topic helpful?​​​​​​​