Complete Tag Helper property reference, service configuration options, and editor command documentation for the RichTextBox ASP.NET Core package.
Tag Helper
All attributes available on the <richtextbox> tag helper element.
| Attribute | Type | Default | Description |
|---|---|---|---|
| id | string | auto | HTML element ID for the editor instance |
| name | string | required | Form field name for the HTML content |
| asp-for | expression | - | Model expression for two-way binding |
| html | string | empty | Initial HTML content for the editor |
| class | string | - | CSS class for the editor wrapper element |
| Attribute | Type | Default | Description |
|---|---|---|---|
| toolbar | string | "default" | Toolbar preset: default, full, basic, ribbon, office, or a custom button string |
| toolbar-mobile | string | "mobile" | Toolbar layout for mobile-width screens |
| Attribute | Type | Default | Description |
|---|---|---|---|
| skin | string | "default" | Visual skin: default, gray, office2007blue, rounded-corner, blue |
| width | string | "100%" | Editor width (CSS value: px, %, em) |
| height | string | "300px" | Editor height (CSS value) |
| resize-mode | string | "both" | Resize mode: both, height, none |
| Attribute | Type | Default | Description |
|---|---|---|---|
| paste-mode | string | "Auto" | Paste handling: Auto, Text, Word, Disabled |
| enter-key-tag | string | "p" | Tag for Enter key: p, div, br |
| url-type | string | "default" | URL processing: default, relative, absolute |
| read-only | bool | false | Makes the editor read-only |
| Attribute | Type | Default | Description |
|---|---|---|---|
| enable-context-menu | bool | false | Enable custom right-click context menu |
| context-menu-mode | string | "Default" | Menu preset: Default, Simple, Minimal |
| Attribute | Type | Default | Description |
|---|---|---|---|
| show-tag-list | bool | true | Show tag path in the bottom bar |
| show-statistics | bool | true | Show character/word statistics in the bottom bar |
| Attribute | Type | Default | Description |
|---|---|---|---|
| content-css-url | string | built-in | URL of a CSS file applied to the content area |
| content-css-text | string | "" | Inline CSS text applied to the content area |
| preview-css-url | string | built-in | CSS file for the preview window |
| editor-body-css-class | string | "" | CSS class applied to the editor body element |
| editor-body-css-text | string | "" | Inline CSS for the editor body element |
| Attribute | Type | Default | Description |
|---|---|---|---|
| image-items-json | string | [] | JSON array of image URLs for the insert image dialog |
| gallery-images-json | string | [] | JSON array of {url, text} objects for the gallery |
| html-templates-json | string | [] | JSON array of [name, html] arrays for templates |
| Attribute | Type | Default | Description |
|---|---|---|---|
| auto-save | bool | false | Enable localStorage draft saving |
| auto-save-key | string | auto | localStorage key for draft isolation |
| auto-save-delay | int | 600 | Delay in milliseconds between saves |
| Attribute | Type | Default | Description |
|---|---|---|---|
| max-html-length | int | 0 (unlimited) | Maximum total HTML characters |
| max-text-length | int | 0 (unlimited) | Maximum visible text characters |
Services
Configure the RichTextBox services in Program.cs.
| Property | Type | Default | Description |
|---|---|---|---|
| UploadWebPath | string | "/uploads" | Web-accessible path for uploaded files |
| MaxUploadBytes | long | 4194304 | Maximum upload file size (4 MB default) |
| AllowedImageExtensions | string[] | .jpg .png .gif .webp .svg | Allowed image file extensions |
| AllowedFileExtensions | string[] | .zip .pdf .doc .docx .rtf .txt | Allowed non-image file extensions |
| RequireValidLicense | bool | true | Require valid license file |
| LicenseNumber | string | "30076785" | Expected license number |
JavaScript
Commands available via editor.execCommand(commandName).
bold, italic, underline, strike, superscript, subscript, removeformat, formatpainter, changecase
fontname, fontsize, forecolor, backcolor, lineheight, paragraphs, inlinestyle
justifyleft, justifycenter, justifyright, justifyfull, ltr, rtl
insertorderedlist, insertunorderedlist, indent, outdent, insertblockquote, inserthorizontalrule, inserttable
insertlink, unlink, insertimage, insertgallery, insertvideo, insertdocument, insertanchor, insertimagemap
insertemoji, insertchars, insertcode, inserttemplate, insertdate, insertbox, insertlayer, insertfieldset
cut, copy, paste, pastetext, pasteword, delete, selectall
code, preview, find, print, fullscreenenter, fullscreenexit, toggleborder, togglemore, help
undo, redo, newdoc, save, load, cleancode
Endpoints
Maps the following endpoints in your ASP.NET Core application:
| Endpoint | Method | Description |
|---|---|---|
| /richtextbox/upload | POST | Upload images and files |
| /richtextbox/gallery | GET/POST | Browse folders, list images, create folders |