Skip to main content

Posts

Showing posts with the label core 2.2 password validation

Validation ASP.NET Core 2.2 MVC | Login Client-Side Validation

This article will cover adding client-side validation to the ASP.NET Core 2.2 . Sometimes we just need a really simple login system for an application. Now I am validating using fields email and password only. Add validation rules to the Login model :     public class LoginViewModel     {         [Required]         [EmailAddress]         [Display(Name = "Email Address" )]         public string Email { get ; set ; }         [Required]         [StringLength(60, MinimumLength = 6)]         [DataType(DataType.Password)]         public string Password { get ; set ; }     } The DataAnnotations applied to the class change the schema. Th...