<asp:TextBox ID="txtCategoryName" class="form-control" runat="server" ontextchanged="txtCategoryName_TextChanged"></asp:TextBox> <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtCategoryName" MinimumPrefixLength="1" EnableCaching="true" CompletionInterval="100" ServiceMethod="GetSuggessions" UseContextKey="true" CompletionSetCount="20"> </cc1:AutoCompleteExtender>
[WebMethod] [System.Web.Script.Services.ScriptMethod] public static List<string> GetSuggessions(string prefixText, int count, string contextKey) { DataSet ds = null; BL.Category objCategory = new BL.Category(); List<string> category = new List<string>(); ds = objCategory.GetAllCategorySearch(prefixText); DataTable dt = ds.Tables[0]; foreach (DataRow row in dt.Rows) // Loop over the rows. { string item = AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(row["CategoryName"].ToString(), row["CatId"].ToString()); category.Add(item); } return category; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)