标签:script text new 添加 content 实体 add write bsp
1. 添加 引用
using System.Web.Script.Serialization;
2.
List<Student> list = new List<Student>();
list.Add(new Student("张三","男",18));
list.Add(new Student("李","女",19));
list.Add(new Student("李", "女", 19));
context.Response.ContentType = "text/javascript";
context.Response.Write(new JavaScriptSerializer().Serialize(list));
说明: Student是一个实体类
标签:script text new 添加 content 实体 add write bsp
原文地址:https://www.cnblogs.com/guoshuguang/p/10239871.html