I have a dropdownlist in which I have to autocomplete the search after I register 3 characters on the search bar. What I was thinking is to register every time I enter a character on the search bar, but I can't get the characters that I am putting on the search bar, so I don't know how to make that, because I have more than 1 million of items on the dropdownlist so I want to search once 3 characters are entered, so I can make the search more bounded. I'm working with MVC with c#, razor, js and chosen plugin. (I'm a Spanish speaker and my English is a work in progress)
@Html.DropDownListFor(x => x.IdPersona, Enumerable.Empty<SelectListItem>(), "Seleccione...", new { @class = "form-control chosen-select", style = "width:100%", id = "nombrepersona"})
$('#nombrepersona_chosen').on("keyup", function () {
inputText = $(this).val();
console.log($(this).value);
console.log("a");
if (inputText.length >= 3) {
// Realizar la búsqueda aquí
console.log(inputText+"entro");
RealizarBusqueda(inputText);
}
});

you can use this script to start search after 3 character keyed in.
});
You can refer to this post for complete solution. : Autocomplete with MVC c#