【发布时间】:2020-08-17 20:30:19
【问题描述】:
我有一个从 IndexedDb 数据源获得的 json 数据。当我执行 Json.stringify 时,我得到的结果为
[{"key":1,"value":{"itemcode":"ItemA3","serialno":"erw33","saledate":"2020-05-03","id":1}},{"key":2,"value":{"itemcode":"ItemA4","serialno":"erewrwerwer","saledate":"2020-05-03","id":2}}]
我希望仅从该字符串中提取值部分并使用 ajax 调用我希望将其传输到具有数组 args 的 c# 函数。
$.ajax({
url: 'Export.aspx/GetDetails',
type: 'POST',
contentType: 'application/json; charset=utf-8',
dataType: 'json',
data: "{detls:" + serializedData + "}",
success: function (r) {
alert("yes");
},
error: function (jqXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
c#函数是
[System.Web.Services.WebMethod]
public static string GetDetails(string [] detls)
{
//get itemcode , serialno , saledate , id
return "s";
}
我收到内部服务器错误
【问题讨论】:
标签: c# asp.net json ajax indexeddb