我想直接调用webservice而不调用controller action方法。这是可能的,如果是这样的话怎么样?我目前的代码不会这样做。
$(document).ready(function () {
$("#txtsearch").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "WebServiceSearch.asmx/GetData",
data: "{'DName':'" + document.getElementById('txtsearch').value + "'}",
dataType: "json",
success: function (data) {
response(data.d);
},
error: function (result) {
alert("Error......");
}
});
}
});
});