[Solved] Autocomplete textbox jquery asp.net

Autocomplete textbox jquery:


In this tutorial, I am going to show you "autocomplete textbox jquery asp.net". JQuery autocomplete facility provides auto-complete and the auto-suggest keyword for the textbox input field like google search, there are multiple ways you can go for autocomplete textbox in JQuery.
Here is the example of asp.net c# textbox which will show you how you can implement an autocomplete textbox in Jquery.

Autocomplete textbox jquery,like google search,asp.net
Autocomplete textbox jquery


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="autocomplete.aspx.cs" Inherits="autocomplete" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
   <title></title>
  
   <%--add these file in head tag--%>
   <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js"></script> 
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js"></script> 
   <link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css" />  

   <script type="text/javascript">
        $(document).ready(function () {
            var availableTags = [
                     "ActionScript",
                     "AppleScript",
                     "Asp",
                     "BASIC",
                     "C",
                     "C++",
                     "Clojure",
                     "COBOL",
                     "ColdFusion",
                     "Erlang",
                     "Fortran",
                     "Groovy",
                     "Haskell",
                     "Java",
                     "JavaScript",
                     "Lisp",
                     "Perl",
                     "PHP",
                     "Python",
                     "Ruby",
                     "Scala",
                     "Scheme"
            ];
            $("#tags").autocomplete({
                source: availableTags
            });
        });
    </script>
</head>

<body>
    <form id="form1" runat="server">
        <div class="demo">
            <div class="ui-widget">
                <asp:Label ID="Label1" runat="server" Text="Enter Text here"></asp:Label>
                <asp:TextBox ID="tags" runat="server"></asp:TextBox>
            </div>
        </div>
    </form>
</body>
</html>

Post a Comment

Post a Comment (0)

Previous Post Next Post