Asp net form not validating
The MVC framework provides several helper methods to display useful error messages to the user. This is used when you have to ensure that two or more properties interact correctly.
To enforce these requirements, I use model validation.
Displaying all error messages on the top of the form might be ok if the form is as short as mine but if the form has 20 rows, the user will be confused with all the error messages.
The solution for this is the Validation Message For HTML helper.
Adding a model level error to the Model State is also achieved by using the Add Model Error with the difference that the first parameter is an empty string.
Additionally, you have to pass true as the parameter for the Validation Summary in the view.