This demo illustrates how to use the Unobtrusive ASP.NET MVC validation approach to validate a user's input. To attach validation rules to input fields, add DataAnnotations attributes to model class properties. For example, the "CreditCardAttribute" validates a field value as a credit card number.
DevExpress MVC Data Editors provide a container for validation error messages. Use the ShowModelErrors property to specify whether data editors display error messages if validation fails. The ValidationSettings property allows you to control how errors are displayed.
Refer to the following online examples for information about other validation approaches:
- DevExpress MVC Data Editors - Model Validation
- DevExpress MVC Data Editors - Built-In Validation
- DevExpress MVC Data Editors - jQuery Client Validation
- GridView - How to implement client-side unobtrusive validation using a custom attribute
See Also:
Local Copy of this Demo To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer. |
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxDataEditorsDemos |