AutoComplete using JQuery

This sample demonstrates how to use AutoComplete functionality using JQuery. AutoComplete is used to like popup panel to display words that has the prefix typed into textbox.

Getting Started

Creating a ASP.NET Application:

  • Open Visual Studio 2010.
  • Go to File => New => Web Site.
  • Select ASP.NET Web Site from the Installed templates
  • Enter the Name and choose the location.
  • Click OK.

Now on page first of all add these .js files inside of head tag.

<title>jQuery Autocomplete Sample</title>
        <link rel="stylesheet" href="theme/jquery.ui.all.css">
        <script src="jquery-1.4.4.js"></script>
        <script src="ui/jquery.ui.core.js"></script>
        <script src="ui/jquery.ui.widget.js"></script>
        <script src="ui/jquery.ui.position.js"></script>
        <script src="ui/jquery.ui.autocomplete.js"></script>

            $(function () {
                var technologies = [
                        "ASP.NET MVC",
                        "BizTalk Server",
                        "Career Advice",
                        "Cloud Computing",
                        "Compact Framework",
                        "Enterprise Development",
                        "Exception Handling",
                        "Financial Applications",
                        "Games Programming",
            "MESSAGE QUEUE",
            "Mobile EMBEDDED",
            "Pocket PC",
            "Project Management",
            "Web Forms",
            "Web Services",
            "Windows Phone"
                    source: technologies
    <style type="text/css">
        #tags {
            width: 249px;

Now add a INPUT html control inside of form tag.

<div class="demo">
    <div class="ui-widget">
        <label for="tags">Technologies: </label>
        <input id="tags"
            style="font-family: 'Cordia New'; font-size: x-large; font-weight: normal; font-style: italic; font-variant: normal; color: #FF0000" />

This is it. Now time to run the application to see the result.



Figure 1.



Figure 2.


Figure 3.

All .js and .css files are in attached application.

This is it. If you have any question or comments then drop me a line in c-sharpcorner comments section.

Similar Articles