SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 209 | Next

Robin Pars, Laurence Moroney, and John Grieb

"Foundations of ASP.NET AJAX"


AutoCompleteExtender Control
The AutoCompleteExtender control is used to suggest text as a user types into a text box and
therefore needs to be associated with an ASP.NET TextBox control. You may think that
most browsers already have the AutoComplete feature turned on because you often see
your name, phone number, and other frequently entered information appear with Auto-
Complete as you type in the same information in other sites. But there is a distinct
difference. The kind of AutoComplete that most browsers have support for only works for
CHAPTER 7 ?–  USING THE ASP.NET AJAX CONTROL TOOLKIT (PART 1) 144
certain fields where it recognizes the field type and suggests text based on your previous
entries.
The AutoCompleteExtender control allows you to define a web service as the data
provider for suggestions. It can query this web service and serve the data back to the
client in true AJAX form without the user noticing any postbacks. The properties of this
control are listed in Table 7-4.
Table 7-4. Attribute Properties of the AutoCompleteExtender Control
Property Name Description
CompletionInterval Elapsed time between suggestions (in milliseconds)
CompletionSetCount Number of suggestions to get from the web service
EnableCaching Boolean value indicating whether or not client caching is enabled
MinimumPrefixLength Minimum number of characters before suggestions are made
ServiceMethod Name of the web method used to retrieve the suggestions
ServicePath Path of the web service used to retrieve a list of suggestions
TargetControlID Target TextBox control for which suggestions will be made
To see this control in action, you would need to create a web service in addition to
the ASP.


Pages:
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221