0
I’m making a input with Autocomplete function only that when typing it returns in the console with error 404. Follow the code:
$(document).ready(function () {
$("#ListaNCM").autocomplete({ source: "ListaAuto.ashx" });
});
And the Generic Handler:
public class ListaAuto : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
string input = context.Request.QueryString["term"];
ProjetoEntities db = new ProjetoEntities();
var Lista = db.Item.Where(x => x.DESCRICAO.Contains(input)).ToList();
context.Response.Write(new JavaScriptSerializer().Serialize(Lista));
}
public bool IsReusable
{
get
{
return false;
}
}
If anyone can help me where I’m going wrong I’d appreciate it.
autocomplete
is jQuery or some other library? I’m not sure if it is possible to indicate howsource
some address, as in an ajax request, because if this is the case, you can first make an ajax request and then fill in the autocomplete with the result.– BrTkCa
@Lucascosta , #Temosomesmonome! and yes to indicate url, is from jqury ui
– Lucas
give a look here https://forums.asp.net/p/1533299/3717070.aspx
– Lucas
I did not understand very well the link that sent @I'mBlueDaBaDee, then
ListaAuto.ashx
source is valid? In which return format will the values for autocomplete be filled in?– BrTkCa
@Lucascosta the link is to Brayan, hahaha
– Lucas