日期:2014-05-17 浏览次数:20480 次
var year = DateTime.Now.Year;
var month = DateTime.Now.Month;
var obj1 = new {
id = 111,
title = "Event1",
start = string.Format("{0}-{1}-{2}", year, month, 10),
url = "http://yahoo.com/"
};
var obj2 = new {
id = 222,
title = "Event2",
start = string.Format("{0}-{1}-{2}", year, month, 20),
end = string.Format("{0}-{1}-{2}", year, month, 22),
url = "http://yahoo.com/"
};
var result = new List<object>();
result.Add(obj1);
result.Add(obj2);
JavaScriptSerializer jss = new JavaScriptSerializer();
Response.Write(jss.Serialize(result.ToArray()));