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