<script type="text/javascript">
$(document).ready(function () {
$("#btnLoad").click(function () {
$.ajax({
type: "POST",
url: "Default.aspx/GetEmpNames",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
for (var i = 0; i < r.d.length; i++) {
$("#gvAuthors").append("<tr><td>" + r.d[i].Loan_id +
"</td><td>" + r.d[i].Name +
"</td><td>" + r.d[i].Name + "</td></tr>");
}
}
});
});
});
$(function () {
$("[id$=txtSearch]").autocomplete({
source: function (request, response) {
$.ajax({
url: '<%=ResolveUrl("~/Default.aspx/GetEmpNames") %>',
data: "{ 'empName': '" + request.term + "'}",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split('-')[0],
val: item.split('-')[1]
}
}))
},
error: function (response) {
alert(response.responseText);
},
failure: function (response) {
alert(response.responseText);
}
});
},
select: function (e, i) {
$("[id$=hfCustomerId]").val(i.item.val);
},
minLength: 1
});
});
Please check my code my record in display textbox but when we click on button gridview not display please check ?