Code: Select all
<script type="text/javascript">
$(function () {
$(".searchPhrase").autocomplete({
source: function (request, response) {
$.ajax({
url: "Search.aspx/Suggest",
data: "{ 'term': '" + request.term + "' }",
dataType: "json",
type: "POST",
contentType: "application/json; charset=utf-8",
dataFilter: function (data) { return data; },
success: function (data) {
response($.map(data.d, function (item) {
return {
value: item
}
}))
},
});
},
minLength: 2
});
});
</script>
much appreciated if anyone who used it can have a hint.