Here is my ajax request:
$("#<% =txtDiagnosisData.ClientID %>").autocomplete({
source: function (request, response) {
$.ajax({
type: "POST",
url: 'EMR.aspx/SearchDiagnosis',
contentType: "application/json;charset=utf-8",
dataType: "json",
success: function (data) {
// response(data.d);
alert("success");
},
error: function (result) {
alert("error");
}
});
}
});
Here is my function:
[WebMethod]
public static List<string> SearchDiagnosis()
{
return new DataAccess().GetDiagnosis();
}
My method is not called from ajax, it always goes to the error part How to solve this?