I've tried to the letter to search for mistakes in my code, but i can't myself get that autocomplete extender to work. Help wanted.
Here's my code: (excerpt from my aspx page)
<asp:TextBox ID="TextBox1" Width="120px" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="TextBox1" ServiceMethod="GetCompletionList" ServicePath="SearchAutoComplete.asmx" MinimumPrefixLength="1">
</cc1:AutoCompleteExtender>
My Webservice code:
[WebMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
List<string> returnData = new List<string>();
MySqlConnection con = new MySqlConnection(Connection.ConnectionString());
string sql = "select title from blog where title like '%" + prefixText + "%'";
MySqlCommand cmd = new MySqlCommand(sql, con);
con.Open();
MySqlDataReader reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);
while (reader.Read())
{
returnData.Add(reader["title"].ToString());
}
return returnData.ToArray();
}