【发布时间】:2010-08-03 17:12:52
【问题描述】:
var OrderInfo = {"ProductID":
"ProductIDValue",
"ProductName": "ProductName",
"Quantity": 1,
"Amount": 9999,
"SLQuantity": 9999,
"SLDate": "08/03/2010"
};
var DTO = { 'OrderInfo': OrderInfo };
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "JasonHandler.ashx",
data: JSON.stringify(DTO),
dataType: "json"
});
我正在尝试通过以下代码在 ASHX 文件中检索服务器端发布的 JSON 数据:
string strrequest = context.Request["OrderInfo"];
但它总是返回 null。我做错了什么?
【问题讨论】:
-
我倾向于将其发布到 .asmx 文件上的 web 方法中,并从 webmethod 的对象中提取参数,而不是使用 ashx。
标签: jquery asp.net contextmenu