HOW TO implement AutoComplete with jQuery & ASP.NET

Auto-completion of search terms is an AJAX feature popularized by Google that reduces typing by listing possible keywords as the user types. ASP.NET developers typically use the AutoComplete Extender that is the part of the ASP.NET AJAX Control Toolkit to plug it to a text box to implement auto-completion. There are other alternatives but one of the best options I've found is jQuery AutoComplete Plugin.

jQuery is a lightweight JavaScript library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. It was released in January 2006 by John Resig, a JavaScript Evangelist for the Mozilla Corporation.

Using the plugin is a no-brainer as the code sample will show. All the grunt work is done by the jQuery Autocomplete Plugin. Building & deploying an Autocomplete solution takes just a few minutes and hardly any lines of code. There are a various specialized jQuery Autocomplete Plugins that offer additional features than the official jQuery Autocomplete Plugin from which they are extended.

Talking of jQuery deployment, Dave Ward recommends having the jQuery's external JavaScript files referenced from the copy at Google AJAX Libraries CDN rather than hosting jQuery on your own server. This has the advantage of providing decreased latency, increased parallelism, and better caching.

Comments