C#后台list转化为json格式


public ActionResult GetData()
{
var lst = new List<Model.calendarevent>();
lst.Add(new Model.calendarevent
{
allDay = true,
confid = 1,
confname = "工作",
confshortname = "M1",
description = "",
end = "2018-12-14 08:30:00",
start = "2018-12-14 08:00:00",
fullname = "开会",
id = 1,
noteType = 1,
sid = 2,
title = "记事簿",
topic = "记事簿",
uid = 3
});
return Json(lst, JsonRequestBehavior.AllowGet);
}

 

写一个model,直接把需要字段添加到model里面,返回这个就行


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM