在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));
原文地址:https://www.cnblogs.com/axu92312/p/5438743.html