The following example shows how to use MinLength attribute. We also used the [Required] attribute. For this you need to go to the body section and make changes in the TextBox that was already created, you just need to Add "ng-maxlength="20" and maxlength validation will be applied, so now your code will look like: This must be an integer value 0 or higher. Here we are demonstrating use of MaxLength property of TextBox. Limit of MaxLength property is 1 to 32767. The ng-maxlength is not the same as the maxlength attribute in HTML, which will prevent users from typing more than the restricted number of characters. The maxlength attribute specifies the maximum number of characters allowed in the element. StringLength is somewhat similar to MaxLength and MinLength attribute but operates only on string type properties. If you get your answer than "Mark as Read" {PropertyValue} = The current value of the property. This will help others find it more readily. I tried the same with Ant design ,it dosn't work for type ="number".I removed type and the maxLength property worked for me .I think it a react issue. MaxLength is used for the Entity Framework to decide how large to make a string value field when it creates the database.. From MSDN: Specifies the maximum length of array or string data allowed in a property. From MSDN: Specifies the maximum length of array or string data allowed in a property. [StringLength(50, MinimumLength = 10, ErrorMessage = "Remark must have min length of 10 and max Length of 50")] public string Remarks { get; set; } The entity framework throws a validation error (EntityValidationError), if the string exceeds Max Length or size is less than Min length specified in this attribute. The value violates the MaxLength limit of this column." MaxLength and MinLength attribute can be used together as shown below. The following example specifies that the Title column in the Books table is to have a maximum length of 150 characters instead of the default which is unlimited: public class Book. < httpRuntime executionTimeout = "240" maxRequestLength = "20480" />. Before I show the code, take note about your use of any maxlength test in the richtext textarea (whether it's done by CF itself in the future or by using this manual test): you (and your users, and any messages you give them) need to take into account that the rich textarea will have a length that's longer than just what the user sees/types. In the above example, we have decorated the LastName property with the StringLength attribute and then specified the Minimum and Maximum length of the model properties. The column called bank has been defined as having a specific maximum number of characters - perhaps the default 50 - and the value you are trying to INSERT or UPDATE to the DB exceeds that length. TextArea maxLength validation. To fix the error, uncomment // the using directive for the namespace for this attribute, // System.Diagnostics. edited. Submitted by IncludeHelp, on September 03, 2018. This must be an integer value 0 or higher. The following example specifies that the Title column in the Books table is to have a maximum length of 150 characters instead of the default which is unlimited: public class Book. The directive is provided with the NG_VALIDATORS multi-provider list. Steps to reproduce Have a string property on your entity, but don;t configure a maxlength. var maxlength=10; var maxtextsize=document.getElementById('txtarea1').value; var c=maxtextsize.length; if(maxlength < c) {alert('maximum length');} else {alert('minimum If no minlength is specified, or an invalid value is specified, the input has no minimum length. Session ID: cdc39558-0a90-4b1d-9849-3de65c7eef75. Works for GUI-less inputs like text, email, url, search, tel and password. [MaxLength(45, ErrorMessage = Translations.Attribute.MAX_LENGTH)] [Required(ErrorMessage = Translations.Attribute.REQUIRED)] How can I create custom Required and MaxLength validation with default translated message. Cannot set column 'bank'. This must be an integer value 0 or higher. The MaxLength attribute is applied to a property to specify a maximum number of characters or bytes for the column that the property should map to. If no minlength is specified, or an invalid value is specified, the input has no minimum length. myTextBox.TextAlignment = TextAlignment.Center; // When the text reaches the edge of the box, go to the next line. Glad to have helped, Ray, and yes, a "countdown counter" would be a nice addition. The minlength attribute defines the minimum number of characters (as UTF-16 code units) the user can enter into an or