Resolved it by changing to a custom message in the catch expression of HttpPost method in the controller rather than in the view.
[HttpPost]
public ActionResult Validate(LoginModel model, string returnUrl) {
try {
if (!ModelState.IsValid) {
throw new AuthenticationException(CustomErrorRes.InvalidEntry);
}
catch (Exception e) {
ModelState.AddModelError(string.Empty, CustomErrorRes.InvalidEntry);
TempData[ACCOUNT_LOGIN_ERROR] = CustomErrorRes.InvalidEntry;
return RedirectToAction("Validate");
}
return RedirectToLocal(returnUrl);
}