我有一个 js 文件。a 想使用 ajax 将值作为 json 传递给我的代码隐藏,但我收到此错误:消息“:”无效的 Web 服务调用,参数缺少值:\u0027fff\u0027。”,“StackTrace
我的 JavaScript 代码是:
var values = { fff: "tttttttt" };
var uname = "fariddddddd";
$.ajax({
type: "GET",
url: "http://localhost:39787/Default.aspx/dataSave",
data: JSON.stringify(values),
contentType: "application/json; charset=utf-8",
dataType: "json",
processData: false,
success: function (msg) {
AjaxSucceeded(msg);
},
error: function (msg) {
alert(msg);
}
});
我背后的代码是:
[WebMethod(true)]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public static string dataSave(string fff)
{
string a = fff + "kazemi";
return a;
}
请帮我