ASP.NET AutoCompleteType Property

Definition and Usage

The AutoCompleteType property is used to set or return the type of AutoComplete for the TextBox control.

To assist users in data entry, Microsoft Internet Explorer 5 and higher versions and Netscape both support a feature called AutoComplete.

The AutoComplete feature can create a list of values that have been entered in the text box. When the text box is used again, the list of entered values or displayed. Users can directly select values without needing to re-enter previously entered values.

Use the AutoCompleteType property to control the behavior of the auto-complete feature of the TextBox control. The System.Web.UI.WebControls.AutoCompleteType enumeration is used to represent the values that can be applied to the AutoCompleteType property.

Syntax

<asp:TextBox AutoCompleteType="cat" runat="server"/>
Property Description
cat

Specify the type of auto-completion. The default value is None.

Possible values:System.Web.UI.WebControls.AutoCompleteType enumeration valuesOne of them.

Instance

The following example sets the AutoCompleteType mode to "HomePhone":

<form runat="server">
<asp:TextBox id="tb1" runat="server" AutoCompleteType="HomePhone" />
</form>

Instance

Set the AutoCompleteType property of the TextBox control

AutoCompleteType Enumeration

Member Name Description
BusinessCity The category of the city where the office address is located.
BusinessCountryRegion The category of the country/region where the office address is located.
BusinessFax The category of the fax number of the office address.
BusinessPhone Category for the phone number of the business address.
BusinessState Category for the state of the business address.
BusinessStreetAddress Category for the street address of the business address.
BusinessUrl Category for the URL of the business website.
BusinessZipCode Category for the postal code of the business address.
Cellular Category for the mobile phone number.
Company Category for the name of the enterprise.
Department Category for the department within the enterprise.
Disabled Disable the auto-complete feature for the TextBox control.
DisplayName Category for the name displayed for the user.
Email Category for the user's email address.
FirstName Category for the user's name.
Gender Category for the user's gender.
HomeCity Category for the city of the home address.
HomeCountryRegion Category for the country/region of the home address.
HomeFax Category for the fax number of the home address.
Homepage Category for the URL of the website.
HomePhone Category for the phone number of the home address.
HomeState Category for the state of the home address.
HomeStreetAddress Category for the street address of the home address.
HomeZipCode Category for the postal code of the home address.
JobTitle Category for the user's job title.
LastName Category for the user's last name.
MiddleName Category for the user's middle name.
None No categories are associated with the TextBox control. All TextBox controls with the same ID share the same value list.
Notes Any additional information to be included in the form category.
Office Category for the location of the business office.
Pager Category for paging numbers.
Search Key categories for searching web pages or websites.