TextBox.Size Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the expected length of the specified text box, in characters. The default value for the size of a text box is 0, which means that the browser will use its default text box length. This API is obsolete. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site.

Namespace:   System.Web.UI.MobileControls
Assembly:  System.Web.Mobile (in System.Web.Mobile.dll)

public int Size { get; set; }

Property Value

Type: System.Int32

The expected length of the specified text box, in characters.

Exception Condition

The value is less than zero.

This information is not used to perform validation checks against the actual input value. To perform a validation check against an input value, use the validator controls or the MaxLength property.

This information does determine the rendering behavior. For example, the value of this property helps determine how large to make an input text box in HTML.

.NET Framework
Available since 1.1
Return to top