Generate Web Sites Automatically: Figure 5: Validate Data Edits.
A DynamicValidator control for each field automatically detects mismatched data types or missing data for required fields when the edit control loses the focus and displays an error message adjacent to the field. Maximum data length is enforced by the TextBox’s MaxLength property value. Validation errors reported by the data model (Entity Data Model or LINQ to SQL) appear in a Validation Summary control’s List of Errors. See Additional Resources to access a table that lists custom validation attributes: Range, RegularExpression, Required, and StringLength.