0

我正在尝试连接我正在编写的网络服务。但我一直出现以下错误“无法加载资源:服务器响应状态为 500(内部服务器错误)”我不知道该怎么办?

这是我的ajax代码

var a = "a";
$.ajax({
type: "POST
url: "FethData.asmx/returnEmployeeInfo=?r" + Math.random(),
data:"{s: '" + a + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
cache: false,
success: function (response) {
var result = response.d;
if (result == "OK") {
alert('asd');
 }
},
timeout: function (response) {
alert("timeout");
},
error: function (msg) {
alert("error");
}
})

和我的网络服务

public class FetchData : System.Web.Services.WebService
{
[WebMethod]
public string returnEmployeeInfo(string s)
{
string a = "a";

return "OK";
}


}
4

0 回答 0