Skip to content

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

This sample demonstrates the option to insert an image into the Rich Text Editor content. Click the image button from the toolbar item to insert the image.

Properties

Image tools are used to insert an image into the Rich Text Editor; click on the image to easily customize it using the quick toolbar. The quick toolbar has the following items:

  • Replace – To replace the image with some other image.
  • Align – Align the image with left, center and right (the image gets a paragraph of its own).
  • Image captions – Set the captions for the image.
  • Change size – Modify the width of the image.
  • Delete – Delete the image.
  • Link – Provide the link to the image, open it, edit it or remove it.
  • Display – Display the image inline, or with a break (in a paragraph of its own).
  • Alternate text – Provide the alternative text for the image if the image is not present in the location.
  • Rotate left and right – Turn the picture a quarter. The pixels are drawn again, so the HTML needs no style; a picture from another site cannot be rotated.
  • Resize – To resize the image dimension with the resize handle.
  • WrapText – Controls text flow around an image, with left and right options.

Quick commands are opened as a toolbar on clicking the corresponding element. The commands are passed as a string collection to the image, text and link lists of the QuickToolbarSettings property. EnableAutoUrl makes a link typed without a scheme (www.example.com) work as an address. Format Option (InsertImageSettings.SaveFormat): with Blob a picked file is shown from a blob address while it is edited; the editor’s value always holds the data address, because a blob address dies with the page.