1) I have a textbox to enter initial letters of the item and, 2) a search button on click of which a listbox appears showing the matching searches. 3) I want to convert this into autocomplete extender and want to remove the listbox. Following is my code which I have tried:
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public List<string> OnSearchEntity(string prefixText, int count)
{
List<string> outsideEntities = new List<string>();
DataTable dtOutsideEntity = COIOrganizationCollection.GetOrganizations(prefixText);
for (int i = 0; i < dtOutsideEntity.Rows.Count; i++)
{
outsideEntities.Add(dtOutsideEntity.Rows[i]["Name"].ToString());
}
return outsideEntities;
}
but it is showing an error:
Error 82 No overload for 'OnSearchEntity' matches delegate 'System.Web.UI.ImageClickEventHandler'
I have also tried changing the parameters, viz.
public List<string> OnSearchEntity(object sender, ImageClickEventArgs e)
{
List<string> outsideEntities = new List<string>();
DataTable dtOutsideEntity =COIOrganizationCollection.GetOrganizations(entityName.Text.Trim());
for (int i = 0; i < dtOutsideEntity.Rows.Count; i++)
{
outsideEntities.Add(dtOutsideEntity.Rows[i]["Name"].ToString());
}
return outsideEntities;
}
it again gives an error: Error 83 'System.Collections.Generic.List has the wrong return type
kindly help, or suggest the right way for this conversion.