Back to Devexpress

HtmlEditorExtension Class

aspnet-devexpress-dot-web-dot-mvc-0e08f3c1.md

latest4.7 KB
Original Source

HtmlEditorExtension Class

Represents an extension object implementing the HtmlEditor functionality.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v20.1.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public class HtmlEditorExtension :
    ExtensionBase
vb
Public Class HtmlEditorExtension
    Inherits ExtensionBase

The following members return HtmlEditorExtension objects:

Remarks

To declare the HtmlEditor in a View, invoke the ExtensionsFactory.HtmlEditor helper method. This method returns the HtmlEditor extension that is implemented by the HtmlEditorExtension class.

To configure the HtmlEditor extension, pass the HtmlEditorSettings object to the ExtensionsFactory.HtmlEditor helper method as a parameter. The HtmlEditorSettings object contains all the HtmlEditor extension settings.

Concepts

HtmlEditor Overview

Example

razor
@Html.DevExpress().HtmlEditorFor(m => m.Html, settings => {
    settings.CallbackRouteValues = new { Controller = "Features", Action = "FeaturesPartial" };
    settings.Height = Unit.Pixel(370);

    settings.SettingsHtmlEditing.AllowScripts = Model.AllowScripts;
    settings.SettingsHtmlEditing.AllowIFrames = Model.AllowIFrames;
    settings.SettingsHtmlEditing.AllowFormElements = Model.AllowFormElements;
    settings.SettingsHtmlEditing.UpdateDeprecatedElements = Model.UpdateDeprecatedElements;
    settings.SettingsHtmlEditing.UpdateBoldItalic = Model.UpdateBoldItalic;
    settings.SettingsHtmlEditing.EnterMode = Model.EnterMode;
    settings.SettingsHtmlEditing.AllowIdAttributes = Model.AllowIdAttributes;
    settings.SettingsHtmlEditing.AllowStyleAttributes = Model.AllowStyleAttributes;
    settings.SettingsHtmlEditing.AllowedDocumentType = Model.AllowedDocumentType;
    settings.SettingsHtmlEditing.AllowEditFullDocument = Model.AllowEditFullDocument;
    settings.SettingsHtmlEditing.ResourcePathMode = Model.ResourcePathMode;
    settings.Settings.AllowCustomColorsInColorPickers = Model.AllowCustomColorsInColorPickers;

    Model.PrepareHtmlEditorSettings(settings);
}).GetHtml()

Online Demos

HTML Editor

Inheritance

Object ExtensionBase HtmlEditorExtension

See Also

HtmlEditorExtension Members

HTML Editor

HtmlEditorSettings

DevExpress.Web.Mvc Namespace