日期:2014-05-16  浏览次数:20474 次

jquery 将list类型转换为json格式数据,在页面迭代显示

准备工作

·Customer

?

?

public class Customer

{

??? public int Unid { get; set; }

??? public string CustomerName { get; set; }

??? public string Memo { get; set; }

??? public string Other { get; set; }

}

?

?

·服务端处理(Json_1.ashx

?

?

Customer customer = new Customer

????? { Unid=1,CustomerName="宋江",Memo="天魁星",Other="黑三郎"};

string strJson = Newtonsoft.Json.JsonConvert.SerializeObject(customer);

?

context.Response.Write(strJson);

?

?

(一)Jquery. getJSON