Hello friends I have a problem. I take clients through TextBox AutoComplete Ajax. But here when I want also want to attract customers, also that which users belong to this customer. How is this possible. I share code. Can anyone help me please.
Here I get data with İnner Join.
//string sql = string.Format("SELECT Title,Name FROM Customer LEFT JOIN User As T3 ON T3.Id = Customer.IdSaler WHERE Title like '%{0}%' Order BY Title LIMIT 10", text);
Here is Html Page Ajax Code
<script>
$(function () {
$("#txtCustomer").autocomplete({
minLength: 3,
source: function (request, response) {
$.ajax({
url: "API.ashx",
data: 'Token=GetCustomersForAutoComplete&Param1=' + request.term,
dataType: "json",
success: function (data) {
response(data);
}
});
},
select: function (event, ui) {
$("#txtCustomer").val(ui.item.Title);
$("#hdnCustomer").val(ui.item.CustomerId);
return false;
}
}).autocomplete("instance")._renderItem = function (ul, item) {
return $("<li>").append(item.Title).appendTo(ul);
};
});
</script>