Ajax Control Toolkit AutoComplete Extender Control is attached to the Text Box to perform autocomplete operations. It will show words when entered; i.e, suggested keywords in the text box. As I have configured it for countries and entered the keyword pa, it will show a list that contains all the countries that contain "pa" in their names.

It generates the drop down list of the suggested words by keyword, after fetching from the Web Service.

You can learn more in my previous parts here,

The best thing about the autocomplete is that as you type the repetitive words in an autocomplete extender control, it does not make a new call but shows it from cache.

It uses the Web Services and the method name to fetch the required list to return.

Now we will check out the initial code with its output.
  1. <asp:TextBox ID="myTextBox" runat="server"></asp:TextBox>
  2. <div class="row">
  3. <div id="ajaxcontroltoolkitplaceholder">
  4. <ajaxToolkit:AutoCompleteExtender runat="server" ID="autoComplete1" TargetControlID="myTextBox" ServiceMethod="GetCountriesList" ServicePath="AutoComplete.asmx" MinimumPrefixLength="2" ShowOnlyCurrentWordInCompletionListItem="true">
  5. </ajaxToolkit:AutoCompleteExtender>
  6. </div>
  7. </div>
Output

Output

So, let’s start to check its properties in detail.
  1. <ajaxToolkit:AutoCompleteExtender
  2. runat="server"
  3. ID="autoComplete1"
  4. TargetControlID="myTextBox"
  5. ServiceMethod="GetCountriesList"
  6. ServicePath="AutoComplete.asmx"
  7. UseContextKey="true"
  8. MinimumPrefixLength="2"
  9. CompletionInterval="1000"
  10. EnableCaching="true"
  11. CompletionSetCount="3"
  12. CompletionListCssClass="CompletionList"
  13. CompletionListItemCssClass="CompletionListItem"
  14. CompletionListHighlightedItemCssClass="CompletionListHighlightedItem"
  15. FirstRowSelected="true"
  16. DelimiterCharacters=", "
  17. ShowOnlyCurrentWordInCompletionListItem="true">
  18. </ajaxToolkit:AutoCompleteExtender>