Validating user input

by  |  16-Jan-2018 15:24

In this course, author Jess Chadwick reviews the Model-View-Controller (MVC) architecture at the heart of ASP.

NET MVC and shows how to create a model, execute controller logic, and interact with models via views.

The following diagram shows a high-level overview of the classes involved in validation: To participate in validation, model classes must derive from the Validatable Base class, which provides an error container whose contents are updated whenever a model class property value changes.

The Validator and Validatable Base classes both implement INotify Property Changed in order to provide property change notification.

Validation rules can be specified on the model properties by using data annotations that derive from the Validation Attribute class.

Community Discussion