我创建了一个客户 JSON对象,它下面有值:结果显示为空
{"Title":"Mr","FirstName":"S","LastName":"J","Birthday":"01/01/2011","Address":[{"Line1":"Line1","Line2":"Line2","City":"City","State":"State","Zip":"00000","County":"0000"},{"Line1":"Line11","Line2":"Line21","City":"City1","State":"State1","Zip":"11111","County":"1111"}],"Email":[{"Email":"[email protected]","EmailType":"Personal"},{"Email":"[email protected]","EmailType":"Work"}],"Phone":[{"Phone":"1231231234","PhoneType":"Mobile"},{"Phone":"1231232345","PhoneType":"Work"}]}
我需要在处理程序相关的数据/ CustomerHandler.ashx做一些数据库操作。 我的AJAX调用如下:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "Handlers/CustomerHandler.ashx",
data: Customer,
dataType: "json",
success: insertCustomerCallback
});
Dim customerJSON As String = HttpContext.Current.Request.Form("Customer")
显示为空。