js代码
Ext.onReady(function () {
Ext.Ajax.request({
url: 'GetJsonData.ashx',
method: 'post',
success: function (response, options) {
//for (i in options) {
// alert('options参数名称:' + i);
// alert('options参数[' + i + ']的值:' + options[i]);
//}
var responseJson = eval("(" + response.responseText + ")");
alert(responseJson.ProductName);
},
failure: function () {
alert('出错!');
}
});
});
一般处理事件
public void ProcessRequest(HttpContext context)
{
context.Response.Write("{'ProductName': ['苹果汁', '蕃茄酱', '盐', '麻油'],'UnitPrice':[ 18,19,20,21]}");
}