O'Reilly logo

ASP.NET jQuery Cookbook by Sonal Aneel Allana

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an auto complete search box

With the widespread use of AJAX in web programming, many online search applications now provide auto complete search boxes. The retrieval of the matching search keywords is done by posting AJAX calls to server side code that links to a backend database.

In this recipe, we will use the auto complete widget provided by jQuery UI to demonstrate an auto complete search box. We will post the AJAX request to an ASP.NET HTTP handler for the retrieval of the matching search keywords.

Getting ready

  1. Add a HTTP handler SearchKeys.ashx to the project.
  2. Add the following namespaces to the code-behind:
    using System.Collections.Generic;
    using System.Web.Script.Serialization;
    
  3. The HTTP Handler implements IHttpHandler and contains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required