Sending JSON object successfully to ASP.NET WebMethod, using jQuery

后端 未结 6 1434
执念已碎
执念已碎 2020-12-05 00:55

I\'ve been working on this for 3 hours and have given up. I am simply trying to send data to an ASP.NET WebMethod, using jQuery. The data is basically a bunch of key/value p

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-05 01:20

    This is the way you define your data (JSON)

    data: { 'items': items },
    

    and the this the way it should be

    data: '{ items: " '+items +' "}',
    

    basically you are serializing the parameter.

提交回复
热议问题