Recent Lessons

Search

Rss Lessons

Rss Blog

 

Autocomplete Asp.Net Control

This is an example of the autocomplete control. You can type some words into the control to see it populate the box. The control makes a call to a generic handler (.ashx) file.

The example queries a lyrics database for the band Queen. Whilst many words are catalogued, example words that definitely provide a result include White, Queen. The webservice will be queried after the second letter is typed.

The asp.net control queries a webservice for information based upon the entry into a textbox.

The code for setting up the autocomplete control is simple.  An example looks like:

<RO:AutoComplete ID="myAuto" runat="server" WebserviceUrl="/ajax/lyric.ashx"></RO:AutoComplete>

There are some additional options, such as number of characters to require before requesting information from the webservice.  The webservice needs to return an entry per line.

I will update the example to accept JSON respsonses at a later date.
 

Free Web Development Courses

  • 1

Privacy Policy