在ashx处理程序中,如果返回json串数据?

可以通过一下代码:

 

using System.Collections.Generic;
using System.Web.Script.Serialization;

SortedDictionary<string, object> values = new SortedDictionary<string, object>(); values.Add("list", _sb.ToString()); values.Add("currentpage", pageIndex); values.Add("endflg", pageIndex == datas.TotalPages); context.Response.Write(new JavaScriptSerializer().Serialize(values));

 

posted @ 2016-04-27 14:25  阿旭92312  阅读(437)  评论(0编辑  收藏  举报