I spend a lot of time trying to understand why in razor terms
@HTML.PasswordFor( m => m.Password)
I cannot set the value from the model, the only solution I found was that he entered the value using html properties such as
@HTML.PasswordFor( m => m.Password, new { value = Model.Password })
Am I doing something wrong? right helper ??? this is a field model configuration
[Required(ErrorMessage = "La contraseña es obligatoria.")] [StringLength(100, ErrorMessage = "El {0} debe tener al menos {2} caracteres de longitud.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Contraseña")] public string Password { get; set; }
Is this the only solution?
Jorge source share