This project is read-only.
ContextSensitiveAutoCompleteExtender | AutoComplete QuickStart | Patterns related to autocomplete

AutoComplete Behavior

The ASP.NET AJAX Toolkit contains an AutoComplete extender that you can attach to a TextBox control. When you use this extender, the list of suggestions is provided by a Web service. This means the list of values is produced by logic that runs on the server (it is not limited only to values previously entered by the user) and is consistent on all client computers that has the control installed.
You should consider providing AutoComplete behavior if any of the following situations applies to your application:
  • Users will frequently select an item from a known list.
  • The list of suggested items can be easily constructed.
  • Accuracy is more important than freeform data entry.
  • The number of suggested items is too large to display in a drop-down list box.

Context-Aware AutoComplete

This bundle contains a new extender (ContextSensitiveAutoCompleteExtender) that provides additional capabilities for AutoComplete behavior. Extenders are server controls that you can use to extend a set of ASP.NET server controls by adding client-side functionality. With the ContextSensitiveAutoCompleteExtender extender, you can use values from multiple controls on the Web page to influence the list of suggestions. For example, Figure 1 illustrates a list of suggested zip codes that is relevant for the current values of the city and state controls.
Figure 1
Using AutoComplete behavior to suggest zip codes.

The ContextSensitiveAutoCompleteExtender control implementation uses the value attribute to retrieve context data from the Web page controls. This means you can only use Web page controls that have an attribute named value, such as a TextBox control or a DropDownList control, as the controls the supply context information (you cannot use a RadtioButton control for example).

ContextSensitiveAutoCompleteExtender | AutoComplete QuickStart | Patterns related to autocomplete

Last edited Nov 8, 2007 at 12:44 PM by siacomuzzi, version 3


No comments yet.