我有对象列表:
var things = [];
var obj = {
ayah: line.ayah,
surah: line.surah,
verse: line.verse
};
things.push(obj);
$.ajax({
method: 'GET',
url: "Gateway/Inbound_Request_Handler?action=1",
data:things,
success: function (Data) {
var mera_obj = Data.key;
document.getElementById("Param2").value = '(' + mera_obj.Response_Code + ' , ' + mera_obj.Response_Description + ')';
},
error: function () {
alert("ERROR: can't connect to Server this time");
}
});
和类:
public class thing {
public int surah { get; set; }
public int ayah { get; set; }
public string verse { get; set; }
}
这是控制器方法:
public class GatewayController : Controller
{
[HttpGet]
public ActionResult Inbound_Request_Handler(List<thing> things)
{...}
}
但它仍然显示控制器方法中的列表为空。我不知道我怎么了?