O'Reilly logo

ASP.NET MVC 2 Cookbook by Richard Kimber, Andrew Siemer

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

Autocomplete with jQuery UI

We've already seen how well ASP.NET MVC works with jQuery to provide a rich and graceful client user experience. And that collaboration is at its strongest when working with forms. That's not the end of the story though. Where jQuery is a cross-browser enabler with strong DOM and Ajax support, jQuery UI works to improve the interface with powerful widgets—one such widget is called autocomplete.

In this recipe, we will see how easy it is to use jQuery UI to add advanced features to an ASP.NET MVC form. We'll do this by allowing the user access predefined subjects, via an autocomplete prompt, directly from the server. The subjects will be requested using Ajax and delivered to the client as JSON.

Getting ready

For this recipe, ...

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