基于extjs4.2
controller
//存储数据的类
public class DataLink {
public string Name { get; set; }
public string Address { get; set; }
public int Age { get; set; }
}
public ActionResult MessageBack(string username)
{
//声明泛型
List<DataLink> resultData = new List<DataLink>();
//存储数据到对象中
resultData.Add(new DataLink() { Name = "tetse", Age = 19, Address = "ly" });
//把对象序列化为string
string rs = Newtonsoft.Json.JsonConvert.SerializeObject(resultData);
//返回前端
return Content(rs);
}