1
// 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()
})
コントローラ側のオブジェクトが表示されません.JSS1の一部のエラーが表示されます。戻り値resは空のオブジェクトですが、これは問題ありませんが、オブジェクトと文字列はコントローラで受け取られていないajaxからポストされます。