Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute. Source Error: Line 52: <div class="controls"> Line 53: <div class="col-lg-9"> Line 54: @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control", placeholder = Labels.newPassword, autocomplete = "off" }) Line 55: @Html.ValidationMessageFor(m => m.NewPassword, null, new { @class = "help-inline" }) Line 56: </div> Source File: c:\_Siriusware\Main\SysManager\SysManager.Web\Views\ChangePassword\Index.cshtml Line: 54 Stack Trace: [InvalidOperationException: Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute.]In the model it's defined as
[Required] [RegularExpression(SysManagerConstants.PASSWORD_REGULAR_EXPRESSION, ErrorMessage = "passwordInvalid", ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName =null)] [DataType(DataType.Password)] [Display(Name = "newPassword", ResourceType = typeof(Labels))] public string NewPassword { get; set; }So I just added the ErrorMessageResourceName attribute to the RegularExpression but I don't know what should I set it to. I found this question