From f76aa0bd2d7b9afcea3af61252851ab020c592f2 Mon Sep 17 00:00:00 2001 From: Luke Latham Date: Wed, 27 Sep 2017 14:58:13 -0500 Subject: [PATCH] React to feedback --- aspnetcore/mvc/models/validation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/mvc/models/validation.md b/aspnetcore/mvc/models/validation.md index bd6423cb22..e7ea2d529a 100644 --- a/aspnetcore/mvc/models/validation.md +++ b/aspnetcore/mvc/models/validation.md @@ -63,11 +63,11 @@ Non-nullable [value types](/dotnet/csharp/language-reference/keywords/value-type MVC model binding, which isn't concerned with validation and validation attributes, rejects a form field submission containing a missing value or whitespace for a non-nullable type. Model binding usually ignores missing data for non-nullable types, where the form field is absent from the incoming form data. -Client-side validation always requires a value for a form field that corresponds to a C# property marked `Required`. `Required` can be used to control the client-side validation error message. +Client-side validation requires a value for a form field that corresponds to a model property that you've marked `Required` and for a non-nullable type property that you haven't marked `Required`. `Required` can be used to control the client-side validation error message. The [BindRequired attribute](/aspnet/core/api/microsoft.aspnetcore.mvc.modelbinding.bindrequiredattribute) (also see [Customize model binding behavior with attributes](xref:mvc/models/model-binding#customize-model-binding-behavior-with-attributes)) is useful to ensure form data is complete. When applied to a property, the model binding system requires a value for that property. When applied to a type, the model binding system requires values for all of the properties of that type. -When you create a [Nullable\ type](/dotnet/csharp/programming-guide/nullable-types/) from a value type (for example, `decimal?` or `System.Nullable`) for a property of a model and mark it `Required`, a server-side validation check is performed as if the property were a standard nullable type (for example, a `string`). +When you use a [Nullable\ type](/dotnet/csharp/programming-guide/nullable-types/) (for example, `decimal?` or `System.Nullable`) and mark it `Required`, a server-side validation check is performed as if the property were a standard nullable type (for example, a `string`). ## Model State