【发布时间】:2017-10-25 13:18:22
【问题描述】:
单击按钮时,我在页面加载后将一些数据传递给 .cs 文件。但是在调用 ajax 函数时出现 500 Internal Server Error。
Ajax 函数,
$.ajax({
type: "POST",
url: "Home.aspx/getSelectedData",
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json",
//async: true,
调用函数,
[WebMethod]
[ScriptMethod(UseHttpGet = true)]
public List<pageResult> getSelectedData(string search_value)
{}
我收到以下错误,
**POST http://localhost:4519/Home.aspx/getSelectedData 500 (Internal Server Error)**
【问题讨论】:
-
服务器代码/背后代码错误 - 在服务器环境中打开人类可读的错误代码。
-
这可能有问题: type: "POST" [ScriptMethod(UseHttpGet = true)]
-
我已经尝试过没有这个但那些都不起作用
-
你传递什么样的数据?
-
我正在传递字符串值
标签: javascript c# jquery ajax asp.net-ajax