Change Theme Settings
Change Theme Settings
Themes
 
Metropolis
Moderno
iOS
Material
Material Compact
Office 365
Mulberry
Show All Themes
v
...v

Validation

  • v
  • v
  • Bold (Ctrl+B)
  • Italic (Ctrl+I)
  • Underline
  • Strikethrough
  • Align Left (Ctrl+L)
  • Align Center (Ctrl+E)
  • Align Right (Ctrl+R)
  • Justify (Ctrl+J)
Length of HTML code representing the Editor's content (in characters): 221
Submit


This demo illustrates the content validation capabilities available to you within the DevExpress MVC HTML Editor. You can define Editor content validation logic - both on the client and server - using the following methods:

  • Check if content is empty. Apply the Required attribute to the model property containing the HTML content to force the editor to require input and display a prompt message when validation fails.
  • Provide validation settings by applying the HtmlSettings attribute to the model property containing the HTML content. Validation settings are specified as parameters of this attribute. For example, the AllowScripts parameter allows you to specify whether or not to accept HTML markup containing scripts.
  • Provide custom validation logic on the server side by assigning a custom delegate to the HtmlEditorBinderSettings.ValidationHandler property.
  • Provide custom validation logic on the client side by handling the Editor’s Validation client event or passing the delegate method as a parameter to the extension's GetHtml function, called within the Validation action.

You are free to combine these methods together to augment validation rules when required.