Ajax AutoCompleteExtender Help
i am using Ajax AutoCompleteExtender in my project with a textbox. it work fine and return list of values. Can any help me to hand this list when list contain more than 10 item. i want to show only 10 items at one time with scrollbar.
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Ramu19 pointsPosted Sep 5, 2014, 2:02 AM EDT
public static List<string> SearchCustomers(string prefixText, int count) { using (SqlConnection conn = new SqlConnection()) { conn.ConnectionString = ConfigurationManager .ConnectionStrings["constr"].ConnectionString; using (SqlCommand cmd = new SqlCommand()) { cmd.CommandText = "select ContactName from Customers where " + "ContactName like @SearchText + '%'"; cmd.Parameters.AddWithValue("@SearchText", prefixText); cmd.Connection = conn; conn.Open(); List<string> customers = new List<string>(); using (SqlDataReader sdr = cmd.ExecuteReader()) { while (sdr.Read()) { customers.Add(sdr["ContactName"].ToString()); } } conn.Close(); return customers; } } }Priti Srivastava38 pointsPosted Sep 5, 2014, 4:21 AM EDT
but this is not correct answer of my query.
I did it and the solution is
> *
CompletionListCssClass="productList" EnableViewState="true" Enabled="true" TargetControlID="txtPurProName" MinimumPrefixLength="1" EnableCaching="true" CompletionInterval="1000" CompletionSetCount="1" ServiceMethod="GetProduct" runat="server">
Priti Srivastava38 pointsPosted Sep 5, 2014, 4:28 AM EDT