Extjs获取不到后台回传的json数据
前台Extjs代码:
Ext.onReady(function () {
var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({ url: "/WebService/test/tb_data.ashx" }),
reader: new Ext.data.JsonReader({
totalProperty: "results",
root: "jsonObjs"
},
[
{ name: 'user_name' },
{ name: 'user_id' },
{ name: 'ssyj' }
]
),
listeners: {
load: function () {
alert(store.getCount());
}
}
});
store.load();
});
后台代码:
public void ProcessRequest(HttpContext context)
{
context.Request.ContentEncoding = Encoding.GetEncoding("UTF-8");
context.Response.ContentEncoding = Encoding.GetEncoding("UTF-8");
context.Response.Charset = "UTF-8";
context.Response.ContentType = "text/plain";
&