Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

How To Change Password Validation in ASP.Net MVC

 public class ChangePassword
    {

        [Required(ErrorMessage = "Password is required")]
        [DataType(DataType.Password)]
        [StringLength(100, ErrorMessage = "Minimum {2} and Maximum {1} characters are allowed", MinimumLength = 5)]
        public string OldPassword { get; set; }

        [Required(ErrorMessage = "Password is required")]
        [StringLength(100, ErrorMessage = "Minimum {2} and Maximum {1} characters are allowed", MinimumLength = 5)]
        public string NewPassword { get; set; }

        [Compare("NewPassword", ErrorMessage = "Password doesn't match")]
        public string ConfirmPassword { get; set; }

    }



This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

How To Change Password Validation in ASP.Net MVC

×

Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription

×