首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >其中是MVC3中DataAnnotations的默认错误消息的完整列表

其中是MVC3中DataAnnotations的默认错误消息的完整列表
EN

Stack Overflow用户
提问于 2011-05-25 16:35:23
回答 3查看 10.9K关注 0票数 17

还有另一个MVC本地化问题...

我正在尝试使用本地化的资源文件来本地化ASP.Net MVC3应用程序,以按照推荐的方式在视图中显示文本。

问题是,像往常一样,当试图本地化来自数据注释的默认错误消息时。

我知道您可以在每个属性中指定资源文件和键:

代码语言:javascript
复制
[Required(
ErrorMessageResourceType = typeof(CustomResourceManager), 
ErrorMessageResourceName = "ResourceKey")]
public string Username { get; set; }

甚至,您可以覆盖默认消息,比如:Default resource for data annotations in ASP.NET MVC,这样您就可以保留如下属性:

代码语言:javascript
复制
[Required]
public string Username { get; set; }

最后一种方法就是我所遵循的方法,它只在您想要覆盖的DataAnnotation有且只有一条错误消息时才起作用,因为它总是查找与自定义资源文件中的属性相同的资源键(例如"Required“需要在资源文件中有"RequiredAttribute”项)

其他属性,如StringLength,根据您使用的可选参数,会有多个错误消息。所以,如果你有一个这样的模型:

代码语言:javascript
复制
public class Person
{
    [Required]
    [StringLengthLocalizedAttribute(10, MinimumLength = 5)]
    [Display(Name = "User name")]
    public string UserName { get; set; }
}

错误消息是“The field User name ”必须是一个字符串,其最小长度为 5 ,最大长度为< 10.“>E213

如果将StringLength属性更改为:

代码语言:javascript
复制
    [StringLengthLocalizedAttribute(10)]

错误消息更改为“the field User name be a string with kim length of 10.”“,因此,在本例中,至少有2条默认错误消息需要覆盖,并且@kim-tranjan提供的解决方案失败。

我的部分解决方案是实现我自己的StringLength属性,如下所示:

代码语言:javascript
复制
public class StringLengthLocalizedAttribute : StringLengthAttribute
{
    public StringLengthLocalizedAttribute(int maximumLength) : base(maximumLength)
    {
        ErrorMessageResourceType = typeof(CustomValidationResource);
    }

    public override string FormatErrorMessage(string name)
    {
        ErrorMessageResourceName = MinimumLength > 0 ? "StringLengthAttributeMinMax" : "StringLengthAttributeMax";
        return base.FormatErrorMessage(name);
    }
}

其中我有一个带有验证消息的本地化资源"CustomValidationResource“,并将其设置为ErrorMessageResourceType。然后,覆盖FormatErrorMessage函数,根据可选参数决定应用哪个消息字符串。

所以,这里的问题是:有谁知道我们可以在哪里找到DataAnnotation属性使用的整个资源键列表,然后查看每个属性中有多少不同的错误消息,而不是测试每个错误消息?

或者更好的是,我们可以使用原始的RESX文件来查看字符串模板并使用相同的资源键对其进行本地化吗?这样,只更改ErrorMessageResourceType应该对所有DataAnnotations属性都有效,并且我不需要猜测在本地化字符串中应该将"{1}“或"{2}”放在哪里。

谢谢,Sergi

EN

回答 3

Stack Overflow用户

发布于 2014-06-12 21:43:20

如果你还在寻找验证字符串的概述,你可以在下面找到Tz_提到的来自System.ComponentModel.DataAnnotations.Resources.DataAnnotationsResources类的资源:

代码语言:javascript
复制
[ArgumentIsNullOrWhitespace, The argument '{0}' cannot be null, empty or contain only white space.]
[AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties, The associated metadata type for type '{0}' contains the following unknown properties or fields: {1}. Please make sure that the names of these members match the names of the properties on the main type.]
[AttributeStore_Type_Must_Be_Public, The type '{0}' must be public.]
[AttributeStore_Unknown_Method, The type '{0}' does not contain a public method named '{1}'.]
[AttributeStore_Unknown_Property, The type '{0}' does not contain a public property named '{1}'.]
[Common_NullOrEmpty, Value cannot be null or empty.]
[Common_PropertyNotFound, The property {0}.{1} could not be found.]
[CompareAttribute_MustMatch, '{0}' and '{1}' do not match.]
[CompareAttribute_UnknownProperty, Could not find a property named {0}.]
[CreditCardAttribute_Invalid, The {0} field is not a valid credit card number.]
[CustomValidationAttribute_Method_Must_Return_ValidationResult, The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult.  Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success.]
[CustomValidationAttribute_Method_Not_Found, The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static.]
[CustomValidationAttribute_Method_Required, The CustomValidationAttribute.Method was not specified.]
[CustomValidationAttribute_Method_Signature, The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult {0}(object value, ValidationContext context).  The value can be strongly typed.  The ValidationContext parameter is optional.]
[CustomValidationAttribute_Type_Conversion_Failed, Could not convert the value of type '{0}' to '{1}' as expected by method {2}.{3}.]
[CustomValidationAttribute_Type_Must_Be_Public, The custom validation type '{0}' must be public.]
[CustomValidationAttribute_ValidationError, {0} is not valid.]
[CustomValidationAttribute_ValidatorType_Required, The CustomValidationAttribute.ValidatorType was not specified.]
[DataTypeAttribute_EmptyDataTypeString, The custom DataType string cannot be null or empty.]
[DisplayAttribute_PropertyNotSet, The {0} property has not been set.  Use the {1} method to get the value.]
[EmailAddressAttribute_Invalid, The {0} field is not a valid e-mail address.]
[EnumDataTypeAttribute_TypeCannotBeNull, The type provided for EnumDataTypeAttribute cannot be null.]
[EnumDataTypeAttribute_TypeNeedsToBeAnEnum, The type '{0}' needs to represent an enumeration type.]
[FileExtensionsAttribute_Invalid, The {0} field only accepts files with the following extensions: {1}]
[LocalizableString_LocalizationFailed, Cannot retrieve property '{0}' because localization failed.  Type '{1}' is not public or does not contain a public static string property with the name '{2}'.]
[MaxLengthAttribute_InvalidMaxLength, MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length.]
[MaxLengthAttribute_ValidationError, The field {0} must be a string or array type with a maximum length of '{1}'.]
[MetadataTypeAttribute_TypeCannotBeNull, MetadataClassType cannot be null.]
[MinLengthAttribute_InvalidMinLength, MinLengthAttribute must have a Length value that is zero or greater.]
[MinLengthAttribute_ValidationError, The field {0} must be a string or array type with a minimum length of '{1}'.]
[PhoneAttribute_Invalid, The {0} field is not a valid phone number.]
[RangeAttribute_ArbitraryTypeNotIComparable, The type {0} must implement {1}.]
[RangeAttribute_MinGreaterThanMax, The maximum value '{0}' must be greater than or equal to the minimum value '{1}'.]
[RangeAttribute_Must_Set_Min_And_Max, The minimum and maximum values must be set.]
[RangeAttribute_Must_Set_Operand_Type, The OperandType must be set when strings are used for minimum and maximum values.]
[RangeAttribute_ValidationError, The field {0} must be between {1} and {2}.]
[RegexAttribute_ValidationError, The field {0} must match the regular expression '{1}'.]
[RegularExpressionAttribute_Empty_Pattern, The pattern must be set to a valid regular expression.]
[RequiredAttribute_ValidationError, The {0} field is required.]
[StringLengthAttribute_InvalidMaxLength, The maximum length must be a nonnegative integer.]
[StringLengthAttribute_ValidationError, The field {0} must be a string with a maximum length of {1}.]
[StringLengthAttribute_ValidationErrorIncludingMinimum, The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.]
[UIHintImplementation_ControlParameterKeyIsNotAString, The key parameter at position {0} with value '{1}' is not a string. Every key control parameter must be a string.]
[UIHintImplementation_ControlParameterKeyIsNull, The key parameter at position {0} is null. Every key control parameter must be a string.]
[UIHintImplementation_ControlParameterKeyOccursMoreThanOnce, The key parameter at position {0} with value '{1}' occurs more than once.]
[UIHintImplementation_NeedEvenNumberOfControlParameters, The number of control parameters must be even.]
[UrlAttribute_Invalid, The {0} field is not a valid fully-qualified http, https, or ftp URL.]
[ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource, Either ErrorMessageString or ErrorMessageResourceName must be set, but not both.]
[ValidationAttribute_IsValid_NotImplemented, IsValid(object value) has not been implemented by this class.  The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).]
[ValidationAttribute_NeedBothResourceTypeAndResourceName, Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute.]
[ValidationAttribute_ResourcePropertyNotStringType, The property '{0}' on resource type '{1}' is not a string type.]
[ValidationAttribute_ResourceTypeDoesNotHaveProperty, The resource type '{0}' does not have an accessible static property named '{1}'.]
[ValidationAttribute_ValidationError, The field {0} is invalid.]
[ValidationContext_Must_Be_Method, The ValidationContext for the type '{0}', member name '{1}' must provide the MethodInfo.]
[ValidationContextServiceContainer_ItemAlreadyExists, A service of type '{0}' already exists in the container.]
[Validator_InstanceMustMatchValidationContextInstance, The instance provided must match the ObjectInstance on the ValidationContext supplied.]
[Validator_Property_Value_Wrong_Type, The value for property '{0}' must be of type '{1}'.]

(MVC4、.NET 4.0)

票数 23
EN

Stack Overflow用户

发布于 2011-06-09 00:01:50

如果您使用Reflector之类的工具打开System.ComponentModel.DataAnnotations.dll,您可以打开资源System.ComponentModel.DataAnnotations.Resources.DataAnnotationsResources.resources并进行查看。

您还可以签出提供对资源字符串的访问的System.ComponentModel.DataAnnotations.Resources.DataAnnotationsResources类。

票数 5
EN

Stack Overflow用户

发布于 2018-08-17 20:00:52

如果其他人仍然需要它(尽管问题很老),原始文件就在这里:

https://raw.githubusercontent.com/Microsoft/referencesource/master/System.ComponentModel.DataAnnotations/DataAnnotationsResources.resx

下面是内容,以防有一天他们决定删除它:

代码语言:javascript
复制
<?xml version="1.0" encoding="utf-8"?>
<root>
  <!-- 
    Microsoft ResX Schema 

    Version 2.0

    The primary goals of this format is to allow a simple XML format 
    that is mostly human readable. The generation and parsing of the 
    various data types are done through the TypeConverter classes 
    associated with the data types.

    Example:

    ... ado.net/XML headers & schema ...
    <resheader name="resmimetype">text/microsoft-resx</resheader>
    <resheader name="version">2.0</resheader>
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
        <value>[base64 mime encoded serialized .NET Framework object]</value>
    </data>
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
        <comment>This is a comment</comment>
    </data>

    There are any number of "resheader" rows that contain simple 
    name/value pairs.

    Each data row contains a name, and value. The row also contains a 
    type or mimetype. Type corresponds to a .NET class that support 
    text/value conversion through the TypeConverter architecture. 
    Classes that don't support this are serialized and stored with the 
    mimetype set.

    The mimetype is used for serialized objects, and tells the 
    ResXResourceReader how to depersist the object. This is currently not 
    extensible. For a given mimetype the value must be set accordingly:

    Note - application/x-microsoft.net.object.binary.base64 is the format 
    that the ResXResourceWriter will generate, however the reader can 
    read any of the formats listed below.

    mimetype: application/x-microsoft.net.object.binary.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.soap.base64
    value   : The object must be serialized with 
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
            : and then encoded with base64 encoding.

    mimetype: application/x-microsoft.net.object.bytearray.base64
    value   : The object must be serialized into a byte array 
            : using a System.ComponentModel.TypeConverter
            : and then encoded with base64 encoding.
    -->
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:element name="root" msdata:IsDataSet="true">
      <xsd:complexType>
        <xsd:choice maxOccurs="unbounded">
          <xsd:element name="metadata">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
              </xsd:sequence>
              <xsd:attribute name="name" use="required" type="xsd:string" />
              <xsd:attribute name="type" type="xsd:string" />
              <xsd:attribute name="mimetype" type="xsd:string" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="assembly">
            <xsd:complexType>
              <xsd:attribute name="alias" type="xsd:string" />
              <xsd:attribute name="name" type="xsd:string" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="data">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
              <xsd:attribute ref="xml:space" />
            </xsd:complexType>
          </xsd:element>
          <xsd:element name="resheader">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
              </xsd:sequence>
              <xsd:attribute name="name" type="xsd:string" use="required" />
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:complexType>
    </xsd:element>
  </xsd:schema>
  <resheader name="resmimetype">
    <value>text/microsoft-resx</value>
  </resheader>
  <resheader name="version">
    <value>2.0</value>
  </resheader>
  <resheader name="reader">
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <resheader name="writer">
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  </resheader>
  <data name="AssociatedMetadataTypeTypeDescriptor_MetadataTypeContainsUnknownProperties" xml:space="preserve">
    <value>The associated metadata type for type '{0}' contains the following unknown properties or fields: {1}. Please make sure that the names of these members match the names of the properties on the main type.</value>
  </data>
  <data name="AttributeStore_Type_Must_Be_Public" xml:space="preserve">
    <value>The type '{0}' must be public.</value>
  </data>
  <data name="AttributeStore_Unknown_Method" xml:space="preserve">
    <value>The type '{0}' does not contain a public method named '{1}'.</value>
  </data>
  <data name="AttributeStore_Unknown_Property" xml:space="preserve">
    <value>The type '{0}' does not contain a public property named '{1}'.</value>
  </data>
  <data name="CustomValidationAttribute_Method_Must_Return_ValidationResult" xml:space="preserve">
    <value>The CustomValidationAttribute method '{0}' in type '{1}' must return System.ComponentModel.DataAnnotations.ValidationResult.  Use System.ComponentModel.DataAnnotations.ValidationResult.Success to represent success.</value>
  </data>
  <data name="CustomValidationAttribute_Method_Not_Found" xml:space="preserve">
    <value>The CustomValidationAttribute method '{0}' does not exist in type '{1}' or is not public and static.</value>
  </data>
  <data name="CustomValidationAttribute_Method_Required" xml:space="preserve">
    <value>The CustomValidationAttribute.Method was not specified.</value>
  </data>
  <data name="CustomValidationAttribute_Method_Signature" xml:space="preserve">
    <value>The CustomValidationAttribute method '{0}' in type '{1}' must match the expected signature: public static ValidationResult {0}(object value, ValidationContext context).  The value can be strongly typed.  The ValidationContext parameter is optional.</value>
  </data>
  <data name="CustomValidationAttribute_Type_Must_Be_Public" xml:space="preserve">
    <value>The custom validation type '{0}' must be public.</value>
  </data>
  <data name="CustomValidationAttribute_ValidationError" xml:space="preserve">
    <value>{0} is not valid.</value>
  </data>
  <data name="CustomValidationAttribute_ValidatorType_Required" xml:space="preserve">
    <value>The CustomValidationAttribute.ValidatorType was not specified.</value>
  </data>
  <data name="DataTypeAttribute_EmptyDataTypeString" xml:space="preserve">
    <value>The custom DataType string cannot be null or empty.</value>
  </data>
  <data name="LocalizableString_LocalizationFailed" xml:space="preserve">
    <value>Cannot retrieve property '{0}' because localization failed.  Type '{1}' is not public or does not contain a public static string property with the name '{2}'.</value>
  </data>
  <data name="Validator_Property_Value_Wrong_Type" xml:space="preserve">
    <value>The value for property '{0}' must be of type '{1}'.</value>
  </data>
  <data name="RangeAttribute_ArbitraryTypeNotIComparable" xml:space="preserve">
    <value>The type {0} must implement {1}.</value>
  </data>
  <data name="RangeAttribute_MinGreaterThanMax" xml:space="preserve">
    <value>The maximum value '{0}' must be greater than or equal to the minimum value '{1}'.</value>
  </data>
  <data name="RangeAttribute_Must_Set_Min_And_Max" xml:space="preserve">
    <value>The minimum and maximum values must be set.</value>
  </data>
  <data name="RangeAttribute_Must_Set_Operand_Type" xml:space="preserve">
    <value>The OperandType must be set when strings are used for minimum and maximum values.</value>
  </data>
  <data name="RangeAttribute_ValidationError" xml:space="preserve">
    <value>The field {0} must be between {1} and {2}.</value>
  </data>
  <data name="RegexAttribute_ValidationError" xml:space="preserve">
    <value>The field {0} must match the regular expression '{1}'.</value>
  </data>
  <data name="RegularExpressionAttribute_Empty_Pattern" xml:space="preserve">
    <value>The pattern must be set to a valid regular expression.</value>
  </data>
  <data name="RequiredAttribute_ValidationError" xml:space="preserve">
    <value>The {0} field is required.</value>
  </data>
  <data name="StringLengthAttribute_InvalidMaxLength" xml:space="preserve">
    <value>The maximum length must be a nonnegative integer.</value>
  </data>
  <data name="StringLengthAttribute_ValidationError" xml:space="preserve">
    <value>The field {0} must be a string with a maximum length of {1}.</value>
  </data>
  <data name="UIHintImplementation_ControlParameterKeyIsNotAString" xml:space="preserve">
    <value>The key parameter at position {0} with value '{1}' is not a string. Every key control parameter must be a string.</value>
  </data>
  <data name="UIHintImplementation_ControlParameterKeyIsNull" xml:space="preserve">
    <value>The key parameter at position {0} is null. Every key control parameter must be a string.</value>
  </data>
  <data name="UIHintImplementation_NeedEvenNumberOfControlParameters" xml:space="preserve">
    <value>The number of control parameters must be even.</value>
  </data>
  <data name="UIHintImplementation_ControlParameterKeyOccursMoreThanOnce" xml:space="preserve">
    <value>The key parameter at position {0} with value '{1}' occurs more than once.</value>
  </data>
  <data name="ValidationAttribute_Cannot_Set_ErrorMessage_And_Resource" xml:space="preserve">
    <value>Either ErrorMessageString or ErrorMessageResourceName must be set, but not both.</value>
  </data>
  <data name="ValidationAttribute_NeedBothResourceTypeAndResourceName" xml:space="preserve">
    <value>Both ErrorMessageResourceType and ErrorMessageResourceName need to be set on this attribute.</value>
  </data>
  <data name="ValidationAttribute_ResourcePropertyNotStringType" xml:space="preserve">
    <value>The property '{0}' on resource type '{1}' is not a string type.</value>
  </data>
  <data name="ValidationAttribute_ResourceTypeDoesNotHaveProperty" xml:space="preserve">
    <value>The resource type '{0}' does not have an accessible static property named '{1}'.</value>
  </data>
  <data name="ValidationAttribute_ValidationError" xml:space="preserve">
    <value>The field {0} is invalid.</value>
  </data>
  <data name="ValidationContext_Must_Be_Method" xml:space="preserve">
    <value>The ValidationContext for the type '{0}', member name '{1}' must provide the MethodInfo.</value>
  </data>
  <data name="EnumDataTypeAttribute_TypeNeedsToBeAnEnum" xml:space="preserve">
    <value>The type '{0}' needs to represent an enumeration type.</value>
  </data>
  <data name="EnumDataTypeAttribute_TypeCannotBeNull" xml:space="preserve">
    <value>The type provided for EnumDataTypeAttribute cannot be null.</value>
  </data>
  <data name="MetadataTypeAttribute_TypeCannotBeNull" xml:space="preserve">
    <value>MetadataClassType cannot be null.</value>
  </data>
  <data name="DisplayAttribute_PropertyNotSet" xml:space="preserve">
    <value>The {0} property has not been set.  Use the {1} method to get the value.</value>
  </data>
  <data name="ValidationContextServiceContainer_ItemAlreadyExists" xml:space="preserve">
    <value>A service of type '{0}' already exists in the container.</value>
  </data>
  <data name="Validator_InstanceMustMatchValidationContextInstance" xml:space="preserve">
    <value>The instance provided must match the ObjectInstance on the ValidationContext supplied.</value>
  </data>
  <data name="ValidationAttribute_IsValid_NotImplemented" xml:space="preserve">
    <value>IsValid(object value) has not been implemented by this class.  The preferred entry point is GetValidationResult() and classes should override IsValid(object value, ValidationContext context).</value>
  </data>
  <data name="CustomValidationAttribute_Type_Conversion_Failed" xml:space="preserve">
    <value>Could not convert the value of type '{0}' to '{1}' as expected by method {2}.{3}.</value>
  </data>
  <data name="StringLengthAttribute_ValidationErrorIncludingMinimum" xml:space="preserve">
    <value>The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.</value>
  </data>
  <data name="CreditCardAttribute_Invalid" xml:space="preserve">
    <value>The {0} field is not a valid credit card number.</value>
  </data>
  <data name="EmailAddressAttribute_Invalid" xml:space="preserve">
    <value>The {0} field is not a valid e-mail address.</value>
  </data>
  <data name="FileExtensionsAttribute_Invalid" xml:space="preserve">
    <value>The {0} field only accepts files with the following extensions: {1}</value>
  </data>
  <data name="UrlAttribute_Invalid" xml:space="preserve">
    <value>The {0} field is not a valid fully-qualified http, https, or ftp URL.</value>
  </data>
  <data name="CompareAttribute_MustMatch" xml:space="preserve">
    <value>'{0}' and '{1}' do not match.</value>
  </data>
  <data name="Common_NullOrEmpty" xml:space="preserve">
    <value>Value cannot be null or empty.</value>
  </data>
  <data name="CompareAttribute_UnknownProperty" xml:space="preserve">
    <value>Could not find a property named {0}.</value>
  </data>
  <data name="Common_PropertyNotFound" xml:space="preserve">
    <value>The property {0}.{1} could not be found.</value>
  </data>
  <data name="PhoneAttribute_Invalid" xml:space="preserve">
    <value>The {0} field is not a valid phone number.</value>
  </data>
  <data name="MaxLengthAttribute_InvalidMaxLength" xml:space="preserve">
    <value>MaxLengthAttribute must have a Length value that is greater than zero. Use MaxLength() without parameters to indicate that the string or array can have the maximum allowable length.</value>
  </data>
  <data name="MaxLengthAttribute_ValidationError" xml:space="preserve">
    <value>The field {0} must be a string or array type with a maximum length of '{1}'.</value>
  </data>
  <data name="MinLengthAttribute_InvalidMinLength" xml:space="preserve">
    <value>MinLengthAttribute must have a Length value that is zero or greater.</value>
  </data>
  <data name="MinLengthAttribute_ValidationError" xml:space="preserve">
    <value>The field {0} must be a string or array type with a minimum length of '{1}'.</value>
  </data>
  <data name="ArgumentIsNullOrWhitespace" xml:space="preserve">
    <value>The argument '{0}' cannot be null, empty or contain only white space.</value>
  </data>
</root>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6121650

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档