2010-08-03 49 views
5

下面的代碼是從MSDN抓起:http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.stringlengthattribute.aspxStringLengthAttribute和本地化的文本

[MetadataType(typeof(ProductMetadata))] 
public partial class Product 
{ 

} 

public class ProductMetadata 
{ 

    [ScaffoldColumn(true)] 
    [StringLength(4, ErrorMessage = "The ThumbnailPhotoFileName value cannot exceed 4 characters. ")] 
    public object ThumbnailPhotoFileName; 

} 

如何申請本地化的文本(例如:從資源文件)的錯誤信息?

回答