public JsonResult GetPropertiesTheoDoiNo(string request) { List <string> results = new List <string>(); foreach (string pro in DaiLy.searchKeysTheoDoiNo()) { results.Add(request + pro); } return(Json(results, JsonRequestBehavior.AllowGet)); }
//Khi gõ từ khóa lọc private void txbLoc_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 123) { txbLoc.Text = txbLoc.Text + "{"; string request = txbLoc.Text; var pros = DaiLy.searchKeysTheoDoiNo(); AutoCompleteStringCollection source = new AutoCompleteStringCollection(); foreach (var info in pros) { source.Add(request + info); } txbLoc.AutoCompleteCustomSource = source; } }