<head runat="server">
<title>AutoComplete Text Box using jQuery in ASP.NET</title>
<link href="jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery-ui.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
SearchText();
});
function SearchText() {
$("#txtEmpName").autocomplete({
source: function(request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Default.aspx/GetEmployeeName",
data: "{'empName':'" + document.getElementById('txtEmpName').value + "'}",
dataType: "json",
success: function(data) {
response(data.d);
},
error: function(result) {
alert("No Match");
}
});
}
});
}
</script>
</head>
Loading

Delpin Susai RajPosted Oct 2, 2016, 11:37 AM
Midhun TpPosted Oct 2, 2016, 12:38 PM
Are you getting any errors?
If no please check whether you are getting response from the ajax page by debugging your script. I think the issue is with ajax posting. Just make sure you are getting response from ajax method.
kuldeep sumanPosted Oct 2, 2016, 11:46 AM