Autocomplet extender control in ajax (asp.net)?
<p>I am using autocomplete extender in my application but it is not working. This is my code:</p>

<pre><code>&lt;form id="form1" runat="server"&gt;
&lt;asp:scriptmanager ID="Scriptmanager1" runat="server"&gt;&lt;/asp:scriptmanager&gt;
    &lt;br /&gt;
    &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
&lt;div&gt;
    &lt;cc1:AutoCompleteExtender TargetControlID="TextBox1" MinimumPrefixLength="1" 
    ServiceMethod="GetVideoTitles" CompletionSetCount="10" ServicePath="Myservices.asmx" ID="AutoCompleteExtender1" runat="server"&gt;
    &lt;/cc1:AutoCompleteExtender&gt;
&lt;/div&gt;
&lt;/form&gt;
</code></pre>

<p>This is the webservice method:</p>

<pre><code>public string[] GetVideoTitles(string prefixText)
{

    SqlConnection con = new SqlConnection(@"Data Source=SERVER5\SQLserver2005;Initial Catalog=tpvnew;User ID=xx;Password=525");
    con.Open();
    SqlCommand cmd = new SqlCommand("video_videotitles", con);
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.Parameters.Add("@prefixText", SqlDbType.VarChar, 50);
    cmd.Parameters["@prefixText"].Value = prefixText;

    SqlDataAdapter da = new SqlDataAdapter(cmd);
    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["videotitle"].ToString(), i);
        i++;
    }
    return items;
}
</code></pre>
