Validate Model State automatically in ASP.NET Core 2.0 #aspnetcore

added by DotNetKicks
2/13/2018 5:49:28 AM

2 Kicks, 365 Views

A ModelState is a collection of name and value pairs submitted to the server during a POST request. It also contains a collection of error messages for each value. The Modelstate represents validation errors in submitted HTML form values. Model validation is the first statement in each controller action method to check for any error before moving forward.