i did but still getting error
[WebMethod]
public static string[] GetNames(string prefix)
{
List<string> users = new List<string>();
using (SqlConnection conn = new SqlConnection())
{
conn.ConnectionString = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
using (SqlCommand cmd = new SqlCommand())
{
cmd.CommandText = "select Name from User3 where " + "Id like @SearchText + '%'";
cmd.Parameters.AddWithValue("@SearchText", prefix);
cmd.Connection = conn;
conn.Open();
using (SqlDataReader sdr = cmd.ExecuteReader())
{
while (sdr.Read())
{
users.Add(string.Format("{0}-{1}", sdr["Name"], sdr["Id"]));
}
}
conn.Close();
}
}
return users.ToArray();
error
Server Error in '/' Application.
AjaxControlToolkit.AutoCompleteExtender missing required ServiceMethod property value for txtSearch_AutoCompleteExtender.
Parameter name: ServiceMethod
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: AjaxControlToolkit.AutoCompleteExtender missing required ServiceMethod property value for txtSearch_AutoCompleteExtender.
Parameter name: ServiceMethod
Source Error:
Line 6: source: function (request, response) {
Line 7: $.ajax({
Line 8: url: '<%=ResolveUrl("~/Timeline.aspx/GetNames") %>',
Line 9: data: "{ 'prefix': '" + request.term + "'}",
Line 10: dataType: "json",