Tôi muốn nhận thông báo lỗi từ tài nguyên. Khi tôi đã thử mã dưới đây tôi có lỗi đó: "Một đối số thuộc tính phải là một biểu thức liên tục, biểu thức typeof hoặc biểu thức tạo mảng của một kiểu tham số thuộc tính" Tôi có thể làm gì?Sử dụng tài nguyên có thông báo lỗi trong mvc
public class UserLoginModel
{
[Required(ErrorMessage =Resources.PageResources.enterYourEmail)]
public String Email{ get; set; }
[Required(ErrorMessage =Resources.PageResources.enterPassword)]
public String Password { get; set;
}
bản sao có thể có của [Tại sao tôi không thể sử dụng tài nguyên như ErrorMessage with DataAnnotations?] (Http://stackoverflow.com/questions/2688888/why-cant-i-use-resources-as-errormessage- with-dataannotations) – Liam