diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicMaxLengthAttributeAdapter.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicMaxLengthAttributeAdapter.cs index ca3b3ce7ab..9791534aac 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicMaxLengthAttributeAdapter.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/DataAnnotations/DynamicMaxLengthAttributeAdapter.cs @@ -33,12 +33,13 @@ namespace Volo.Abp.AspNetCore.Mvc.DataAnnotations { Check.NotNull(context, nameof(context)); - MergeAttribute(context.Attributes, "data-val", "true"); - MergeAttribute(context.Attributes, "data-val-length", GetErrorMessage(context)); + MergeAttribute(context.Attributes, "data-val", "true"); + MergeAttribute(context.Attributes, "data-val-maxlength", GetErrorMessage(context)); + MergeAttribute(context.Attributes, "data-val-maxlength-max", _max); if (Attribute.Length != int.MaxValue) { - MergeAttribute(context.Attributes, "data-val-length-max", _max); + MergeAttribute(context.Attributes, "data-val-maxlength-max", _max); } } }