'Autocomplete jQuery not working in webform

I use asp.net webform textbox for autocomplete. In my textbox when i type any value, there is no suggestion shown. Here is my code in Default.aspx:

<link rel="Stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css" />
<script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js"></script>
<script src="https://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function () {
        $('#txtName').autocomplete({
            source: 'AutoCompleteCase.ashx'
        });
    });
</script>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>

AutoCompleteCase.ashx:

    public void ProcessRequest(HttpContext context)
    {
        string term = context.Request["term"] ?? "";
        List<string> list = new List<string>();
        SqlConnection con = new SqlConnection(@"Data Source=PC01\SQL2012;Initial Catalog=elawdb;Integrated Security=True");
        string sqlquery = string.Format("Select ReferredTitle from refcases where ReferredTitle LIKE '%{0}%'", term);
        con.Open();
        SqlCommand cmd = new SqlCommand(sqlquery, con);
        SqlDataReader rdr = cmd.ExecuteReader();
        while (rdr.Read())
        {
            list.Add(rdr["ReferredTitle"].ToString());
        }

        JavaScriptSerializer js = new JavaScriptSerializer();
        context.Response.Write(js.Serialize(list));
    }

Any idea where it go wrong?



Solution 1:[1]

please walk through this link, similar kind of concept used to get the auto complete text.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TechieWords