Autocomplete in Ajax not working?
<p>In Ajax, i am using autocompleteExender in my asp.net application, i write the service for that, when i run that service it is working fine, when i place autocompleteextender in asp.net page and assign properity for ajax autocompleteextender it is not working. this is my code service: </p>

<pre><code>[WebMethod]
public string[] GetCompletionList(string prefixText)
{
    SqlConnection con=new SqlConnection
     ("server=******;database=Mydb;user id=***;password=****;");
    string sql = "Select productname from F_Product
      Where productname like '" + prefixText + "%'";
    SqlDataAdapter da = new SqlDataAdapter(sql, con); 
     try
    {
        DataTable dt = new DataTable();
        da.Fill(dt);
        string[] items = new string[dt.Rows.Count];
        int i = 0;
        foreach (DataRow dr in dt.Rows)
        {
            items.SetValue(dr[0].ToString(), i);
            i++;
        }
        return items; 
    }
    catch
    {
        return null;
    }
    finally
    {
        con.Close();

    }
</code></pre>

<p>and this is my ajax autocompleteextender code.</p>

<pre><code>&lt;asp:AutoCompleteExtender ID="AutoCompleteExtender1" MinimumPrefixLength="2"
     TargetControlID ="TextBox1" ServiceMethod="GetCompletionList"
       ServicePath="~/Autocomplete.asmx"
         runat="server"&gt;
    &lt;/asp:AutoCompleteExtender&gt; 
    &lt;asp:TextBox ID="TextBox1" runat="server"
     Width="213px"&gt;&lt;/asp:TextBox&gt;
</code></pre>
