Is it possible to compare confirm password textbox\'s text with
@Html.PasswordFor(model=>model.Password)
?
@using (Html.BeginForm())
{
Using Compare
DataAnnotation
it will be easy to compare password but if model genrate from database use NotMapped
, NotMapped Properties In An Entity Framework Using A Code-First Strategy
[Required]
public string Password { get; set; }
[NotMapped] // Does not effect with your database
[Compare("Password")]
public string ConfirmPassword { get; set; }