[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Chart Control
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Site Navigation and Layout
  [Collapse]HTML Editor
    Main Features
    Getting Started
    Html Editor Designer
    [Expand]View Modes
    [Expand]Get and Set HTML
     Context Menu
    [Collapse]Content Filtering and Validation
     [Expand]HTML Validation
      Content Element Filtering
      Paste Formatting
      Content Validation
     Searching Content
     Client-Side Commands
     Keyboard Shortcuts
     Import and Export
     Support for SharePoint
   [Expand]Visual Elements
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Content Validation

ASPxHtmlEditor provides a built-in means to perform powerful validation of its content, both on the client and server. Different validation settings are available for customization via the editor's ASPxHtmlEditor.SettingsValidation property.

To define editor validation logic, use the following methods (which can be combined together if required).

An editor's client validation can be triggered automatically via a click on the ASPxButton, whose ASPxButton.CausesValidation property is set to true. You can also manually initiate an editor's client validation by using the editor's ASPxClientHtmlEditor.Validate client method or specific static client methods (such as ASPxClientEdit.ValidateEditorsInContainer, ASPxClientEdit.ValidateEditorsInContainerById, or ASPxClientEdit.ValidateGroup).

An editor's server validation is always performed while processing an external postback, if the editor's content has been changed. The server validation can also be initiated programmatically via the editor's ASPxHtmlEditor.Validate server method call, or the ASPxEdit.ValidateEditorsInContainer static server method.

Additionally, you can validate an editor's content programmatically (if required) and indicate the validation result manually by either setting the editor's ASPxHtmlEditor.IsValid server property or calling the ASPxClientHtmlEditor.SetIsValid client method.

When an editor fails validation logic, a built-in frame with validation errors can be displayed within the editor's View. To customize the appearance of the frame and its Close button, use the HtmlEditorValidationSettings.ErrorFrameStyle, HtmlEditorValidationSettings.ErrorFrameCloseButtonStyle, and HtmlEditorImages.ErrorFrameCloseButton properties. The error text can be specified via the HtmlEditorValidationSettings.ErrorText property in the Validation event handlers or via the editor's ASPxHtmlEditor.ErrorText property (depending upon the validation method used).

Is this topic helpful?​​​​​​​