AutoCompleteType Enumeration
Represents the values that control the behavior of the AutoComplete feature in a TextBox control.
Assembly: System.Web (in System.Web.dll)
| Member name | Description | |
|---|---|---|
| None | No category is associated with the TextBox control. All TextBox controls with the same ID share the same value list. | |
| Disabled | The AutoComplete feature is disabled for the TextBox control. | |
| Cellular | The phone number for a mobile-phone category. | |
| Company | The name of a business category. | |
| Department | A department within a business category. | |
| DisplayName | The name to display for the user category. | |
| The user's e-mail address category. | ||
| FirstName | The first name of the user category. | |
| Gender | The gender of the user category. | |
| HomeCity | The city for a home address category. | |
| HomeCountryRegion | The country/region for a home address category. | |
| HomeFax | The fax number for a home address category. | |
| HomePhone | The phone number for a home address category. | |
| HomeState | The state for a home address category. | |
| HomeStreetAddress | The street for a home address category. | |
| HomeZipCode | The ZIP code for a home address category. | |
| Homepage | The URL to a Web site category. | |
| JobTitle | The user's job title category. | |
| LastName | The user's last name category. | |
| MiddleName | The user's middle name category. | |
| Notes | Any supplemental information to include in the form category. | |
| Office | The location of the business office category. | |
| Pager | The phone number for a pager category. | |
| BusinessCity | The city for a business address category. | |
| BusinessCountryRegion | The country/region for a business address category. | |
| BusinessFax | The fax number for a business address category. | |
| BusinessPhone | The phone number for a business address category. | |
| BusinessState | The state for a business address category. | |
| BusinessStreetAddress | The street for a business address category. | |
| BusinessUrl | The URL to a business Web site category. | |
| BusinessZipCode | The ZIP code for a business address category. | |
| Search | The keyword or keywords with which to search a Web page or Web site category. |
To assist with data entry, Internet Explorer 5 and later and some other browsers support a feature called AutoComplete. AutoComplete monitors a text box and creates a list of values entered by the user. When the user returns to the text box at a later time, the list is displayed. Instead of retyping a previously entered value, the user can simply select the value from this list. To control the behavior of the AutoComplete feature for a TextBox control, use the AutoCompleteType property. The AutoCompleteType enumeration is used to represent the values that you can apply to the AutoCompleteType property.
Note |
|---|
Not all browsers support the AutoComplete feature. Check with your browser to determine compatibility. |
By default, the AutoCompleteType property for a TextBox control is set to AutoCompleteType.None. With this setting, the TextBox control shares the list with other TextBox controls with the same ID across different pages. You can also share a list among TextBox controls based on a category, instead of an ID. When you set the AutoCompleteType property to one of the category values (such as AutoCompleteType.FirstName, AutoCompleteType.LastName, and so on), all TextBox controls with the same category share the same list. You can disable the AutoComplete feature for a TextBox control by setting the AutoCompleteType property to AutoCompleteType.Disabled.
Refer to your browser documentation for details on configuring and enabling the AutoComplete feature. For example, to enable the AutoComplete feature in Internet Explorer version 5 or later, select Internet Options from the Tools menu; then select the Content tab. Click the AutoComplete button to view and modify the various browser options for the AutoComplete feature.
For more information on the AutoComplete feature in Internet Explorer, search for the Using AutoComplete in HTML Forms topic in the MSDN Library at http://msdn.microsoft.com/library.
The following example demonstrates how to use the AutoCompleteType enumeration to specify the AutoComplete category for a TextBox control.
Security Note |
|---|
This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see Script Exploits Overview. |
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note
Security Note