I have got this error when trying to navigate to login view in my browser in a project that I have been working on.

I have got a username property in my AccountViewModel
public class LoginViewModel
{
[Required(ErrorMessageResourceName = "UserNameRequired")]
[Display(Name = "UserName")]
public string UserName { get; set; }
[Required(ErrorMessageResourceName = "PasswordRequired")]
[Display(Name = "Password")]
[DataType(DataType.Password)]
public string Password { get; set; }
[Display(Name = "RememberMe")]
public bool RememberMe { get; set; }
}
How can I avoid this problem? Can anyone suggest me a solution?
After I have changed the required attribute like this
[Required(ErrorMessageResourceType = typeof(InitialCreate1),ErrorMessageResourceName = "UserNameInvalid", ErrorMessage = null)]
[Display(Name = "UserName")]
public string UserName { get; set; }
I have got this new error
Server Error in '/' Application.
Either ErrorMessageString or ErrorMessageResourceName must be set, but not both.
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: Either ErrorMessageString or ErrorMessageResourceName must be set, but not both.
Source Error:
Line 17: @Html.LabelFor(m => m.UserName, new { @class = "col-md-2 control-label" }) Line 18: Line 19: @Html.TextBoxFor(m => m.UserName, new { @class = "form-control" }) Line 20: @Html.ValidationMessageFor(m => m.UserName) Line 21:
What can I do about this? Please help me?
