ASP.NET Core - EJ2

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class RichTextEditor

    Show / Hide Table of Contents

    Class RichTextEditor

    Inheritance
    System.Object
    EJTagHelper
    RichTextEditor
    Inherited Members
    EJTagHelper.GetList()
    EJTagHelper.Process(TagHelperContext, TagHelperOutput)
    EJTagHelper.RegisterScript()
    EJTagHelper.GetSerializedProperties()
    EJTagHelper.GetScriptString()
    EJTagHelper.GetHtmlAttrString(IDictionary<String, Object>)
    EJTagHelper.ViewContext
    EJTagHelper.Id
    EJTagHelper.IsChild
    EJTagHelper.IsComplex
    EJTagHelper.IsCollection
    EJTagHelper.ParentPropertyName
    Namespace: Syncfusion.EJ2.RichTextEditor
    Assembly: Syncfusion.EJ2.dll
    Syntax
    public class RichTextEditor : EJTagHelper

    Constructors

    RichTextEditor()

    Declaration
    public RichTextEditor()

    Properties

    ActionBegin

    Triggers before command execution using toolbar items or executeCommand method. If you cancel this event, the command cannot be executed. Set the cancel argument to true to cancel the command execution.

    Declaration
    public string ActionBegin { get; set; }
    Property Value
    Type Description
    System.String

    ActionComplete

    Triggers after command execution using toolbar items or executeCommand method.

    Declaration
    public string ActionComplete { get; set; }
    Property Value
    Type Description
    System.String

    AfterImageDelete

    Event triggers when the selected image is cleared from the Rich Text Editor Content.

    Declaration
    public string AfterImageDelete { get; set; }
    Property Value
    Type Description
    System.String

    AfterMediaDelete

    Declaration
    public string AfterMediaDelete { get; set; }
    Property Value
    Type Description
    System.String

    AfterPasteCleanup

    Declaration
    public string AfterPasteCleanup { get; set; }
    Property Value
    Type Description
    System.String

    AutoSaveOnIdle

    Enables or disables the auto-save option which performs the save action while in the idle state after typed content. If enabled, the Rich Text Editor will save the content on idle state with saveInterval property's value. The change event will be triggered if the content has changed from the last saved state.

    Declaration
    public bool AutoSaveOnIdle { get; set; }
    Property Value
    Type Description
    System.Boolean

    BackgroundColor

    Predefine the color palette that can be rendered for background color (text highlighted color) toolbar command.

    Declaration
    public RichTextEditorBackgroundColor BackgroundColor { get; set; }
    Property Value
    Type Description
    RichTextEditorBackgroundColor

    BeforeDialogClose

    Event triggers when the dialog is being closed. If you cancel this event, the dialog remains opened. Set the cancel argument to true to prevent closing a dialog.

    Declaration
    public string BeforeDialogClose { get; set; }
    Property Value
    Type Description
    System.String

    BeforeDialogOpen

    Event triggers when the dialog is being opened. If you cancel this event, the dialog remains closed. Set the cancel argument to true to cancel the open of a dialog.

    Declaration
    public string BeforeDialogOpen { get; set; }
    Property Value
    Type Description
    System.String

    BeforeFileUpload

    Declaration
    public string BeforeFileUpload { get; set; }
    Property Value
    Type Description
    System.String

    BeforeImageDrop

    Declaration
    public string BeforeImageDrop { get; set; }
    Property Value
    Type Description
    System.String

    BeforeImageUpload

    Event triggers before the image upload process.

    Declaration
    public string BeforeImageUpload { get; set; }
    Property Value
    Type Description
    System.String

    BeforePasteCleanup

    Declaration
    public string BeforePasteCleanup { get; set; }
    Property Value
    Type Description
    System.String

    BeforeQuickToolbarOpen

    Event triggers when the quick toolbar is being opened.

    Declaration
    public string BeforeQuickToolbarOpen { get; set; }
    Property Value
    Type Description
    System.String

    BeforeSanitizeHtml

    Event triggers before sanitize the value. It's only applicable to editorMode as HTML.

    Declaration
    public string BeforeSanitizeHtml { get; set; }
    Property Value
    Type Description
    System.String

    Blur

    Triggers when Rich Text Editor is focused out.

    Declaration
    public string Blur { get; set; }
    Property Value
    Type Description
    System.String

    BulletFormatList

    Declaration
    public RichTextEditorBulletFormatList BulletFormatList { get; set; }
    Property Value
    Type Description
    RichTextEditorBulletFormatList

    Change

    Triggers only when Rich Text Editor is blurred and changes are done to the content.

    Declaration
    public string Change { get; set; }
    Property Value
    Type Description
    System.String

    ClassName

    Declaration
    protected override string ClassName { get; }
    Property Value
    Type Description
    System.String
    Overrides
    EJTagHelper.ClassName

    ContentTemplate

    To get or set value for ContentTemplate.

    Declaration
    public MvcTemplate<object> ContentTemplate { get; set; }
    Property Value
    Type Description
    MvcTemplate<System.Object>

    Created

    Triggers when the Rich Text Editor is rendered.

    Declaration
    public string Created { get; set; }
    Property Value
    Type Description
    System.String

    CssClass

    Specifies the CSS class name appended with the root element of the RichTextEditor. One or more custom CSS classes can be added to a RichTextEditor.

    Declaration
    public string CssClass { get; set; }
    Property Value
    Type Description
    System.String

    Destroyed

    Triggers when the Rich Text Editor is destroyed.

    Declaration
    public string Destroyed { get; set; }
    Property Value
    Type Description
    System.String

    DialogClose

    Event triggers after the dialog has been closed.

    Declaration
    public string DialogClose { get; set; }
    Property Value
    Type Description
    System.String

    DialogOpen

    Event triggers when a dialog is opened.

    Declaration
    public string DialogOpen { get; set; }
    Property Value
    Type Description
    System.String

    EditorMode

    Specifies the editing mode of the RichTextEditor.

    Declaration
    public EditorMode EditorMode { get; set; }
    Property Value
    Type Description
    EditorMode

    EnableAutoUrl

    Enable enableAutoUrl to accept the given URL (relative or absolute) without validating the URL for hyperlinks, otherwise the given URL will automatically convert to absolute path URL by prefixing https:// for hyperlinks.

    Declaration
    public bool EnableAutoUrl { get; set; }
    Property Value
    Type Description
    System.Boolean

    Enabled

    Specifies a value that indicates whether the component is enabled or not.

    Declaration
    public bool Enabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableHtmlEncode

    specifies the value whether the source code is displayed with encoded format.

    Declaration
    public bool EnableHtmlEncode { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableHtmlSanitizer

    Defines whether to allow the cross-scripting site or not.

    Declaration
    public bool EnableHtmlSanitizer { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnablePersistence

    Enables or disables the persisting component's state between page reloads. If enabled, the value of Rich Text Editor is persisted

    Declaration
    public bool EnablePersistence { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableResize

    Enables or disables the resizing option in the editor. If enabled, the Rich Text Editor can be resized by dragging the resize icon in the bottom right corner.

    Declaration
    public bool EnableResize { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableRtl

    Enable or disable rendering component in right to left direction.

    Declaration
    public bool EnableRtl { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableTabKey

    Allows the tab key action in the Rich Text Editor content.

    Declaration
    public bool EnableTabKey { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnableXhtml

    Specifies a value that indicates whether the xhtml is enabled or not.

    Declaration
    public bool EnableXhtml { get; set; }
    Property Value
    Type Description
    System.Boolean

    EnterKey

    Declaration
    public EnterKey EnterKey { get; set; }
    Property Value
    Type Description
    EnterKey

    FileManagerSettings

    Declaration
    public RichTextEditorFileManagerSettings FileManagerSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorFileManagerSettings

    FileRemoving

    Declaration
    public string FileRemoving { get; set; }
    Property Value
    Type Description
    System.String

    FileSelected

    Declaration
    public string FileSelected { get; set; }
    Property Value
    Type Description
    System.String

    FileUploadFailed

    Declaration
    public string FileUploadFailed { get; set; }
    Property Value
    Type Description
    System.String

    FileUploading

    Declaration
    public string FileUploading { get; set; }
    Property Value
    Type Description
    System.String

    FileUploadSuccess

    Declaration
    public string FileUploadSuccess { get; set; }
    Property Value
    Type Description
    System.String

    FloatingToolbarOffset

    Preserves the toolbar at the top of the Rich Text Editor on scrolling and specifies the offset of the floating toolbar from documents top position

    Declaration
    public double FloatingToolbarOffset { get; set; }
    Property Value
    Type Description
    System.Double

    Focus

    Triggers when Rich Text Editor is focused in

    Declaration
    public string Focus { get; set; }
    Property Value
    Type Description
    System.String

    FontColor

    Predefine the color palette that can be rendered for font color toolbar command .

    Declaration
    public RichTextEditorFontColor FontColor { get; set; }
    Property Value
    Type Description
    RichTextEditorFontColor

    FontFamily

    Predefine the font families that populate in font family dropdown list from the toolbar.

    Declaration
    public RichTextEditorFontFamily FontFamily { get; set; }
    Property Value
    Type Description
    RichTextEditorFontFamily

    FontSize

    Predefine the font sizes that populate in font size dropdown list from the toolbar.

    Declaration
    public RichTextEditorFontSize FontSize { get; set; }
    Property Value
    Type Description
    RichTextEditorFontSize

    For

    Declaration
    public override ModelExpression For { get; set; }
    Property Value
    Type Description
    Microsoft.AspNetCore.Mvc.ViewFeatures.ModelExpression
    Overrides
    EJTagHelper.For

    Format

    Predefine the collection of paragraph styles along with quote and code style that populate in format dropdown from the toolbar.

    Declaration
    public RichTextEditorFormat Format { get; set; }
    Property Value
    Type Description
    RichTextEditorFormat

    Formatter

    Customize keyCode to change the key value.

    Declaration
    public RichTextEditorFormatter Formatter { get; set; }
    Property Value
    Type Description
    RichTextEditorFormatter

    Height

    Specifies the height of the Rich Text Editor component.

    Declaration
    public string Height { get; set; }
    Property Value
    Type Description
    System.String

    HtmlAttributes

    Allows additional HTML attributes such as title, name, etc., and It will be accepts n number of attributes in a key-value pair format.

    Declaration
    public object HtmlAttributes { get; set; }
    Property Value
    Type Description
    System.Object

    IframeSettings

    Specifies the items to be rendered in an iframe mode, and it has the following properties. enable - Set Boolean value to enable, the editors content is placed in an iframe and isolated from the rest of the page. attributes - Custom style to be used inside the iframe to display content. This style is added to the iframe body. resources - we can add both styles and scripts to the iframe.

    1. styles[] - An array of CSS style files to inject inside the iframe to display content
    2. scripts[] - An array of JS script files to inject inside the iframe
    Declaration
    public RichTextEditorIFrameSettings IframeSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorIFrameSettings

    ImageRemoving

    Event triggers when the selected image is cleared from the insert image dialog.

    Declaration
    public string ImageRemoving { get; set; }
    Property Value
    Type Description
    System.String

    ImageSelected

    Event triggers when the image is selected or dragged into the insert image dialog.

    Declaration
    public string ImageSelected { get; set; }
    Property Value
    Type Description
    System.String

    ImageUploadFailed

    Event triggers when there is an error in the image upload.

    Declaration
    public string ImageUploadFailed { get; set; }
    Property Value
    Type Description
    System.String

    ImageUploading

    Event triggers when the selected image begins to upload in the insert image dialog.

    Declaration
    public string ImageUploading { get; set; }
    Property Value
    Type Description
    System.String

    ImageUploadSuccess

    Event triggers when the image is successfully uploaded to the server side.

    Declaration
    public string ImageUploadSuccess { get; set; }
    Property Value
    Type Description
    System.String

    InlineMode

    Enable or disable the inline edit mode. enable - set boolean value to enable or disable the inline edit mode. onSelection - If its set to true, upon selecting the text, the toolbar is opened in inline. If its set to false, upon clicking to the target element, the toolbar is opened.

    Declaration
    public RichTextEditorInlineMode InlineMode { get; set; }
    Property Value
    Type Description
    RichTextEditorInlineMode

    InsertAudioSettings

    Declaration
    public RichTextEditorAudioSettings InsertAudioSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorAudioSettings

    InsertImageSettings

    Specifies the image insert options in Rich Text Editor component and control with the following properties. allowedTypes - Specifies the extensions of the image types allowed to insert on bowering and passing the extensions with comma separators. For example, pass allowedTypes as .jpg and .png. display - Sets the default display for an image when it is inserted in to the RichTextEditor. Possible options are: 'inline' and 'block'. width - Sets the default width of the image when it is inserted in the RichTextEditor. saveFormat - Specifies the format to store the image in the Rich Text Editor (Base64 or Blob).

    If you want to insert a lot of tiny images in the editor and don't want a specific physical location for saving images, you can opt to save format as Base64. height - Sets the default height of the image when it is inserted in the RichTextEditor. saveUrl - Specifies the service URL of save action that will receive the uploaded files and save them in the server. path - Specifies the path of the location to store the images and refer it to display the images.

    Declaration
    public RichTextEditorImageSettings InsertImageSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorImageSettings

    InsertVideoSettings

    Declaration
    public RichTextEditorVideoSettings InsertVideoSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorVideoSettings

    IsFor

    Declaration
    protected override bool IsFor { get; }
    Property Value
    Type Description
    System.Boolean
    Overrides
    EJTagHelper.IsFor

    KeyConfig

    Customizes the key actions in RichTextEditor. For example, when using German keyboard, the key actions can be customized using these shortcuts.

    Declaration
    public object KeyConfig { get; set; }
    Property Value
    Type Description
    System.Object

    Locale

    Overrides the global culture and localization value for this component. Default global culture is 'en-US'.

    Declaration
    public string Locale { get; set; }
    Property Value
    Type Description
    System.String

    MaxLength

    Specifies the maximum number of characters allowed in the Rich Text Editor component.

    Declaration
    public double MaxLength { get; set; }
    Property Value
    Type Description
    System.Double

    NameSpace

    Declaration
    protected override string NameSpace { get; }
    Property Value
    Type Description
    System.String
    Overrides
    EJTagHelper.NameSpace

    NumberFormatList

    Declaration
    public RichTextEditorNumberFormatList NumberFormatList { get; set; }
    Property Value
    Type Description
    RichTextEditorNumberFormatList

    PasteCleanupSettings

    Specifies the pasting options in Rich Text Editor component and control with the following properties. prompt - Set boolean value to enable or disable the prompt when pasting. deniedAttrs - Specifies the attributes to restrict when pasting in RTE. allowedStyleProps - Specifies the allowed style properties when pasting in RTE. deniedTags - Specifies the tags to restrict when pasting in RTE. keepFormat - Set boolean value to keep or remove the from when pasting. plainText - Set boolean value to paste as plain text or not.

    Declaration
    public RichTextEditorPasteCleanupSettings PasteCleanupSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorPasteCleanupSettings

    Placeholder

    Specifies the placeholder for the RichTextEditor’s content used when the Rich Text Editor body is empty.

    Declaration
    public string Placeholder { get; set; }
    Property Value
    Type Description
    System.String

    QuickToolbarClose

    Event triggers after the quick toolbar has been closed.

    Declaration
    public string QuickToolbarClose { get; set; }
    Property Value
    Type Description
    System.String

    QuickToolbarOpen

    Event triggers when a quick toolbar is opened.

    Declaration
    public string QuickToolbarOpen { get; set; }
    Property Value
    Type Description
    System.String

    QuickToolbarSettings

    Specifies the items to be rendered in quick toolbar based on the target element. It has following fields: enable - set boolean value to show or hide the quick toolbar actionOnScroll - it has two possible options

    1. hide: The quickToolbar is closed when the parent element is scrolled.
    2. none: The quickToolbar cannot be closed even the parent element is scrolled. link - Specifies the items to be rendered in quick toolbar based on link element such as Open, Edit, and UnLink. image - Specifies the items to be rendered in quick toolbar based on image element such as 'Replace', 'Align', 'Caption', 'Remove', 'InsertLink', 'Display', 'AltText', 'Dimension'. text - Specifies the items to be rendered in quick toolbar based on text element such as 'Cut', 'Copy', 'Paste'.
    Declaration
    public RichTextEditorQuickToolbarSettings QuickToolbarSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorQuickToolbarSettings

    Readonly

    The user interactions on the component are disabled, when set to true.

    Declaration
    public bool Readonly { get; set; }
    Property Value
    Type Description
    System.Boolean

    ResizeStart

    Triggers only when start resize the image.

    Declaration
    public string ResizeStart { get; set; }
    Property Value
    Type Description
    System.String

    ResizeStop

    Triggers only when stop resize the image.

    Declaration
    public string ResizeStop { get; set; }
    Property Value
    Type Description
    System.String

    Resizing

    Triggers only when resizing the image.

    Declaration
    public string Resizing { get; set; }
    Property Value
    Type Description
    System.String

    SaveInterval

    Specifies the saveInterval in milliseconds for autosave the value. The change event will be triggered if the content was changed from the last saved interval.

    Declaration
    public double SaveInterval { get; set; }
    Property Value
    Type Description
    System.Double

    ShiftEnterKey

    Declaration
    public ShiftEnterKey ShiftEnterKey { get; set; }
    Property Value
    Type Description
    ShiftEnterKey

    ShowCharCount

    Sets Boolean value to enable or disable the display of the character counter.

    Declaration
    public bool ShowCharCount { get; set; }
    Property Value
    Type Description
    System.Boolean

    TableSettings

    Specifies the table insert options in Rich Text Editor component and control with the following properties. styles - Class name should be appended by default in table element. It helps to design the table in specific CSS styles always when inserting in editor. width - Sets the default width of the table when it is inserted in the RichTextEditor. minWidth - Sets the default minWidth of the table when it is inserted in the RichTextEditor. maxWidth - Sets the default maxWidth of the table when it is inserted in the RichTextEditor. resize - To enable resize the table.

    Declaration
    public RichTextEditorTableSettings TableSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorTableSettings

    TagName

    Declaration
    protected override string TagName { get; }
    Property Value
    Type Description
    System.String
    Overrides
    EJTagHelper.TagName

    ToolbarClick

    Triggers when Rich Text Editor Toolbar items is clicked.

    Declaration
    public string ToolbarClick { get; set; }
    Property Value
    Type Description
    System.String

    ToolbarSettings

    Specifies the group of items aligned horizontally in the toolbar as well as defined the toolbar rendering type. By default, toolbar is float at the top of the RichTextEditor. When you scroll down, the toolbar will scroll along with the page on Rich Text Editor with the specified offset value. enable: set boolean value to show or hide the toolbar. enableFloating: Set Boolean value to enable or disable the floating toolbar. Preserves the toolbar at top of the Rich Text Editor on scrolling. type: it has two possible options

    1. Expand: Hide the overflowing toolbar items in the next row. Click the expand arrow to view overflowing toolbar items
    2. MultiRow: The toolbar overflowing items wrapped in the next row. items: Specifies the array of items aligned horizontally in the toolbar.

    | and - can insert a vertical and horizontal separator lines in the toolbar. itemConfigs: Modify the default toolbar item configuration like icon class.

    Declaration
    public RichTextEditorToolbarSettings ToolbarSettings { get; set; }
    Property Value
    Type Description
    RichTextEditorToolbarSettings

    ToolbarStatusUpdate

    Triggers when the undo and redo status is updated.

    Declaration
    public string ToolbarStatusUpdate { get; set; }
    Property Value
    Type Description
    System.String

    UndoRedoSteps

    Specifies the count of undo history which is stored in undoRedoManager.

    Declaration
    public double UndoRedoSteps { get; set; }
    Property Value
    Type Description
    System.Double

    UndoRedoTimer

    Specifies the interval value in milliseconds that store actions in undoRedoManager. The minimum value is 300 milliseconds.

    Declaration
    public double UndoRedoTimer { get; set; }
    Property Value
    Type Description
    System.Double

    UpdatedToolbarStatus

    Declaration
    public string UpdatedToolbarStatus { get; set; }
    Property Value
    Type Description
    System.String

    Value

    Specifies the value displayed in the RichTextEditor's content area and it should be string. The content of Rich Text Editor can be loaded with dynamic data such as database, AJAX content, and more.

    Declaration
    public string Value { get; set; }
    Property Value
    Type Description
    System.String

    ValueTemplate

    Accepts the template design and assigns it as RichTextEditor’s content. The built-in template engine which provides options to compile template string into a executable function. For EX: We have expression evolution as like ES6 expression string literals

    Declaration
    public string ValueTemplate { get; set; }
    Property Value
    Type Description
    System.String

    Width

    Specifies the width of the RichTextEditor.

    Declaration
    public string Width { get; set; }
    Property Value
    Type Description
    System.String
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved