Skip to content

Example of API in ASP.NET MVC Rich Text Editor Control

This sample demonstrates the usage of API in Rich Text Editor. Use the properties panel to change the maximum length, read only mode, disable status, to get value, enable HTML encode, select all content and get selected text from the Rich Text Editor.

Properties

In this demo, we are going to ensure the API’s behaviour by

  • Changing the value of the MaxLength text box to change the maximum length of characters (setSettings({ maxLength })).
  • Clicking the ReadOnly check box to enable or disable the editable and non-editable mode of the editor (setReadOnly()).
  • Clicking the Enabled check box to enable or disable the editor (enable(), disable()).
  • Clicking the EnableHtmlEncode check box to get the value encoded (<p>) in the text area that is posted (setSettings({ enableHtmlEncode })).
  • Clicking the getValue button, which shows the editor’s value in the alert window.
  • Clicking the getSelection button, which shows the selected text in the alert window.
  • Clicking the selectAll button, which selects all the text content in the editor.