The ASP.NET MVC Rich Text Editor (RichEdit) provides a comprehensive API, allowing you to manipulate the open document programmatically on the client side. The available client manipulation API is exposed through the following properties.
Provides access to structures that allow you to obtain the current information about certain document structural elements (such as sections, active sub-document, styles for characters, paragraphs and tables, and etc.).
Provides access to a set of methods that allow you to position the cursor within a document and to select document content elements.
Provides access to client commands that allow you to programmatically accomplish virtually any task within a document (such as inserting characters, paragraphs, tables and pictures, changing element formatting, creating numbered lists, etc.).
Available commands are a powerful tool for manipulating document content on the client using code. Most commands replicate the RichEdit's default UI commands available through the editor's ribbon. These commands are useful when you are required to implement a custom toolbar for the RichEdit instead of the default built-in ribbon. For an example of such a custom toolbar, refer to the Custom Toolbar via Client API demo.
Each command exposes the execute and getState methods. For its execution, a command may require additional data to be passed as the execute method's parameter. The execute method may result in no action taken if a command's state obtained using the getState method does not allow command execution (for instance, in case when a command is not enabled in the ribbon).
This demo is an illustration of how the client API for commands and selection can be used in the RichEdit.