Validation

Conference Registration Form
*
 
*
*
OK
Reset
Description
C#
VB
ASPX

The ASPxGridView and Editors Library provide a powerful and seamless way to perform data validation both on the client and server.

Different validation settings can be customized for an editor using specific properties available via the editor's ValidationSettings property.

To define editor validation logic, the following easy-to-use means are provided (which can be combined together, if required):

  • The ValidationSettings.RequiredField property can be used to force an editor to require input, and give you the ability to display an error message if input is not received.
  • The ValidationSettings.RegularExpression property allows you to validate an editor's value based upon a regular expression.
  • An editor's Validation event can be handled on either the client or server (or both) to setup editor validation. Review the code sample tabs within this demo to learn how easy this really is.

The validation check in this demo is triggered by moving input focus out of the editor or by clicking on the 'OK' ASPxButton control. Commonly, the ASPxButton, whose CausesValidation property is set to true, allows all verifiable controls on a web page to be automatically validated on the client side and server side. Client-side validation of our editors can also be triggered by using one of the following static client methods: ASPxClientEdit.ValidateEditorsInContainer, ASPxClientEdit.ValidateEditorsInContainerById or ASPxClientEdit.ValidateGroup.

When an editor fails validation logic, the following can be displayed:

  • Error image - To define an error image, use the ValidationSettings.ErrorImage property.
  • Error text - The text can be specified by using either the ValidationSettings.ErrorText property or in the Validation event's handler.
  • A specific error frame near the editor - The error frame's appearance is customized via the ValidationSettings.ErrorFrameStyle property.
  • Other similar settings can also be customized via the ValidationSettings property.

Input focus can be forced back to the editor's input region. The ValidationSettings.SetFocusOnError property controls the change in input focus.

This demo illustrates the built-in flexibility and efficiency of our validation engine, allowing you to easily implement different validation scenarios without using additional validator controls.