【发布时间】:2017-01-25 05:12:29
【问题描述】:
// mycontroller
[HttpPost]
public IEnumerable<Obj1> Post([FromBody]Obj2 val, string str1, string str2)
{
Model1 = new function1();
Obj1[] res;
res= client.function1(val, str1, str2);
return res;
}
//myscript
send1.click(function (e) {
$.ajax({
url: action,
datetype: "JSON",
data: {
'val': JSON.stringify($(this).serialize()),
},
cache: false,
type: "POST",
beforeSend: function (data) {}
)
.done()
.fail()
.always()
})
我没有看到控制器端的对象,也许 js send1 中的一些错误有人可以帮助我吗?返回的 res 是一个空对象,这没关系,但是控制器中没有收到来自 ajax 的对象和字符串。
【问题讨论】:
标签: ajax asp.net-web-api