Edit

Share via


TextBox.MaxLength Property

Definition

Gets or sets the maximum number of characters allowed in the text box. The default value is 0, meaning that there is no limit on the length. This API is obsolete. For information about how to develop ASP.NET mobile applications, see Mobile Apps & Sites with ASP.NET.

public:
 property int MaxLength { int get(); void set(int value); };
[System.ComponentModel.Bindable(true)]
public int MaxLength { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.MaxLength : int with get, set
Public Property MaxLength As Integer

Property Value

The maximum number of characters allowed in the text box.

Attributes

Exceptions

The value is less than zero.

Applies to

See also