我創建了一個客戶 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")
顯示爲空。