0

I want know how to use autocomplete with database using ajax and the data get faster on local server and Main server also

And i try this script

$("#SI").autocomplete({
   source: function (request, response) {
      $.ajax({
        url: '@Url.Action("GetSearchValue","Main")',
        dataType: "json",
        data: { search: $("#SI").val() },
        success: function (data) {
            response($.map(data, function (item) {
                return { label: items.Name, value: items.Name };
            }));
        },
        error: function (xhr, status, error) {
            alert("Error");
        }
    });
  }
});
2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.